File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3737 * only if the new code is made subject to such option by the copyright
3838 * holder.
3939 */
40-
4140package com .actionbazaar .application ;
4241
4342import com .actionbazaar .domain .Bid ;
4443
4544public interface BidService {
46- public Bid addBid (Bid bid );
4745
48- public Bid getBid (Long id );
46+ public Bid addBid (Bid bid );
47+
48+ public Bid getBid (Long id );
4949
50- public void updateBid (Bid bid );
50+ public void updateBid (Bid bid );
5151
52- public void deleteBid (Bid bid );
52+ public void deleteBid (Bid bid );
5353}
Original file line number Diff line number Diff line change 3737 * only if the new code is made subject to such option by the copyright
3838 * holder.
3939 */
40-
4140package com .actionbazaar .application ;
4241
4342import javax .ejb .Stateless ;
4948@ Stateless
5049public class DefaultBidService implements BidService {
5150
52- @ Inject
53- private BidRepository bidDao ;
51+ @ Inject
52+ private BidRepository bidRepository ;
5453
55- @ Override
56- public Bid addBid (Bid bid ) {
57- return bidDao .addBid (bid );
58- }
54+ @ Override
55+ public Bid addBid (Bid bid ) {
56+ return bidRepository .addBid (bid );
57+ }
5958
60- @ Override
61- public Bid getBid (Long id ) {
62- return bidDao .getBid (id );
63- }
59+ @ Override
60+ public Bid getBid (Long id ) {
61+ return bidRepository .getBid (id );
62+ }
6463
65- @ Override
66- public void updateBid (Bid bid ) {
67- bidDao .updateBid (bid );
68- }
64+ @ Override
65+ public void updateBid (Bid bid ) {
66+ bidRepository .updateBid (bid );
67+ }
6968
70- @ Override
71- public void deleteBid (Bid bid ) {
72- bidDao .deleteBid (bid );
73- }
74- }
69+ @ Override
70+ public void deleteBid (Bid bid ) {
71+ bidRepository .deleteBid (bid );
72+ }
73+ }
Original file line number Diff line number Diff line change @@ -20,9 +20,9 @@ public class AddBid implements Serializable {
2020 @ Produces
2121 @ Named
2222 @ RequestScoped
23- private Bid bid = new Bid ();
23+ private final Bid bid = new Bid ();
2424
25- public String addBid () {
25+ public String onAdd () {
2626 bidService .addBid (bid );
2727
2828 return "confirm_bid.jsf" ;
Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" UTF-8" ?>
2- <weblogic-web-app xmlns =" http://xmlns.oracle.com/weblogic/weblogic-web-app" xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" xsi : schemaLocation =" http://xmlns.oracle.com/weblogic/weblogic-web-app http://xmlns.oracle.com/weblogic/weblogic-web-app/1.7/weblogic-web-app.xsd" >
3- <context-root >/actionbazaar</context-root >
4- <library-ref >
5- <library-name >jax-rs</library-name >
6- <specification-version >2.0</specification-version >
7- <exact-match >false</exact-match >
8- </library-ref >
9- </weblogic-web-app >
2+ <weblogic-web-app
3+ xmlns =" http://xmlns.oracle.com/weblogic/weblogic-web-app"
4+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
5+ xsi : schemaLocation =" http://xmlns.oracle.com/weblogic/weblogic-web-app http://xmlns.oracle.com/weblogic/weblogic-web-app/1.7/weblogic-web-app.xsd" >
6+ <context-root >/actionbazaar</context-root >
7+ <library-ref >
8+ <library-name >jax-rs</library-name >
9+ <specification-version >2.0</specification-version >
10+ <exact-match >false</exact-match >
11+ </library-ref >
12+ </weblogic-web-app >
Original file line number Diff line number Diff line change 66 < title > Action Bazaar</ title >
77 </ h:head >
88 < h:body >
9+ < h1 > Add Bid</ h1 >
910 < h:form id ="bidForm ">
10- < h1 > Add Bid</ h1 >
1111 < h:panelGrid columns ="2 ">
1212 < h:outputLabel for ="item "> Item name:</ h:outputLabel >
1313 < h:inputText id ="itemTextField " value ="#{bid.item} " />
1616 < h:outputLabel for ="amount "> Bid amount:</ h:outputLabel >
1717 < h:inputText id ="amountTextField " value ="#{bid.amount} " />
1818 </ h:panelGrid >
19- < h:commandButton id ="addBidButton " value ="Add Bid "
20- action ="#{addBid.addBid } " />
19+ < h:commandButton id ="addBidButton " value ="Add Your Bid "
20+ action ="#{addBid.onAdd() } " />
2121 </ h:form >
2222 </ h:body >
2323</ html >
You can’t perform that action at this time.
0 commit comments