Skip to content

Commit 2dce115

Browse files
author
Reza Rahman
committed
Cleanup
1 parent ad59217 commit 2dce115

5 files changed

Lines changed: 40 additions & 38 deletions

File tree

actionbazaar/src/main/java/com/actionbazaar/application/BidService.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,17 @@
3737
* only if the new code is made subject to such option by the copyright
3838
* holder.
3939
*/
40-
4140
package com.actionbazaar.application;
4241

4342
import com.actionbazaar.domain.Bid;
4443

4544
public 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
}

actionbazaar/src/main/java/com/actionbazaar/application/DefaultBidService.java

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
* only if the new code is made subject to such option by the copyright
3838
* holder.
3939
*/
40-
4140
package com.actionbazaar.application;
4241

4342
import javax.ejb.Stateless;
@@ -49,26 +48,26 @@
4948
@Stateless
5049
public 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+
}

actionbazaar/src/main/java/com/actionbazaar/interfaces/web/AddBid.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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";
Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
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>

actionbazaar/src/main/webapp/add_bid.xhtml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
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}" />
@@ -16,8 +16,8 @@
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>

0 commit comments

Comments
 (0)