├── LICENSE
├── README.md
└── jpetstore
├── .classpath
├── .gitignore
├── .project
├── .settings
├── .jsdtscope
├── com.springsource.sts.maven.prefs
├── org.eclipse.jdt.core.prefs
├── org.eclipse.wst.common.component
├── org.eclipse.wst.common.project.facet.core.xml
├── org.eclipse.wst.jsdt.ui.superType.container
├── org.eclipse.wst.jsdt.ui.superType.name
├── org.eclipse.wst.xml.core.prefs
└── org.maven.ide.eclipse.prefs
├── db
├── hsqldb
│ ├── jpetstore-hsqldb-dataload.sql
│ ├── jpetstore-hsqldb-schema.sql
│ ├── jpetstore.lck
│ ├── jpetstore.properties
│ ├── jpetstore.script
│ ├── manager.bat
│ ├── manager.sh
│ ├── pom-manager.xml
│ ├── pom.xml
│ ├── server.bat
│ ├── server.properties
│ └── server.sh
├── mysql
│ ├── jpetstore-mysql-dataload.sql
│ └── jpetstore-mysql-schema.sql
├── oracle
│ ├── jpetstore-oracle-dataload.sql
│ ├── jpetstore-oracle-schema-xa1.sql
│ ├── jpetstore-oracle-schema-xa2.sql
│ └── jpetstore-oracle-schema.sql
├── postgres
│ ├── jpetstore-postgres-dataload.sql
│ └── jpetstore-postgres-schema.sql
└── sqlfire
│ ├── jpetstore-sqlfire-dataload.sql
│ └── jpetstore-sqlfire-schema.sql
├── pom.xml
├── readme.txt
└── src
└── main
├── java
└── org
│ └── springframework
│ └── samples
│ └── jpetstore
│ ├── dao
│ ├── AccountDao.java
│ ├── CategoryDao.java
│ ├── ItemDao.java
│ ├── OrderDao.java
│ ├── ProductDao.java
│ └── springdata
│ │ ├── SpringDataAccountDao.java
│ │ ├── SpringDataCategoryDao.java
│ │ ├── SpringDataItemDao.java
│ │ ├── SpringDataOrderDao.java
│ │ ├── SpringDataProductDao.java
│ │ └── SpringDataSequenceDao.java
│ ├── domain
│ ├── Account.java
│ ├── Cart.java
│ ├── CartItem.java
│ ├── Category.java
│ ├── Item.java
│ ├── LineItem.java
│ ├── Order.java
│ ├── Product.java
│ ├── Sequence.java
│ └── logic
│ │ ├── AccountValidator.java
│ │ ├── OrderService.java
│ │ ├── OrderValidator.java
│ │ ├── PetStoreFacade.java
│ │ ├── PetStoreImpl.java
│ │ └── SendOrderConfirmationEmailAdvice.java
│ ├── generated
│ └── domain
│ │ ├── QAccount.java
│ │ ├── QBannerdata.java
│ │ ├── QCategory.java
│ │ ├── QInventory.java
│ │ ├── QItem.java
│ │ ├── QLineitem.java
│ │ ├── QOrders.java
│ │ ├── QOrderstatus.java
│ │ ├── QProduct.java
│ │ ├── QProfile.java
│ │ ├── QSequence.java
│ │ ├── QSignon.java
│ │ └── QSupplier.java
│ ├── service
│ ├── JaxRpcOrderService.java
│ └── client
│ │ └── OrderServiceClient.java
│ └── web
│ ├── spring
│ ├── AccountForm.java
│ ├── AccountFormController.java
│ ├── AddItemToCartController.java
│ ├── ListOrdersController.java
│ ├── OrderForm.java
│ ├── OrderFormController.java
│ ├── RemoveItemFromCartController.java
│ ├── SearchProductsController.java
│ ├── SignoffController.java
│ ├── SignonController.java
│ ├── SignonInterceptor.java
│ ├── UpdateCartQuantitiesController.java
│ ├── UserSession.java
│ ├── ViewCartController.java
│ ├── ViewCategoryController.java
│ ├── ViewItemController.java
│ ├── ViewOrderController.java
│ └── ViewProductController.java
│ └── struts
│ ├── AccountActionForm.java
│ ├── AddItemToCartAction.java
│ ├── BaseAction.java
│ ├── BaseActionForm.java
│ ├── CartActionForm.java
│ ├── DoNothingAction.java
│ ├── EditAccountAction.java
│ ├── EditAccountFormAction.java
│ ├── ListOrdersAction.java
│ ├── NewAccountAction.java
│ ├── NewAccountFormAction.java
│ ├── NewOrderAction.java
│ ├── NewOrderFormAction.java
│ ├── OrderActionForm.java
│ ├── RemoveItemFromCartAction.java
│ ├── SearchProductsAction.java
│ ├── SecureBaseAction.java
│ ├── SignonAction.java
│ ├── UpdateCartQuantitiesAction.java
│ ├── ViewCartAction.java
│ ├── ViewCategoryAction.java
│ ├── ViewItemAction.java
│ ├── ViewOrderAction.java
│ └── ViewProductAction.java
└── webapp
├── META-INF
└── MANIFEST.MF
├── WEB-INF
├── applicationContext.xml
├── dataAccessContext-jta.xml
├── dataAccessContext-local.xml
├── jdbc.properties
├── jsp
│ ├── spring
│ │ ├── Cart.jsp
│ │ ├── Category.jsp
│ │ ├── Checkout.jsp
│ │ ├── ConfirmOrder.jsp
│ │ ├── EditAccountForm.jsp
│ │ ├── Error.jsp
│ │ ├── IncludeAccountFields.jsp
│ │ ├── IncludeBanner.jsp
│ │ ├── IncludeBottom.jsp
│ │ ├── IncludeMyList.jsp
│ │ ├── IncludeQuickHeader.jsp
│ │ ├── IncludeTop.jsp
│ │ ├── Item.jsp
│ │ ├── ListOrders.jsp
│ │ ├── NewOrderForm.jsp
│ │ ├── Product.jsp
│ │ ├── SearchProducts.jsp
│ │ ├── ShippingForm.jsp
│ │ ├── SignonForm.jsp
│ │ ├── ViewOrder.jsp
│ │ └── index.jsp
│ └── struts
│ │ ├── Cart.jsp
│ │ ├── Category.jsp
│ │ ├── Checkout.jsp
│ │ ├── ConfirmOrder.jsp
│ │ ├── EditAccountForm.jsp
│ │ ├── Error.jsp
│ │ ├── IncludeAccountFields.jsp
│ │ ├── IncludeBanner.jsp
│ │ ├── IncludeBottom.jsp
│ │ ├── IncludeMyList.jsp
│ │ ├── IncludeQuickHeader.jsp
│ │ ├── IncludeTop.jsp
│ │ ├── Item.jsp
│ │ ├── ListOrders.jsp
│ │ ├── NewAccountForm.jsp
│ │ ├── NewOrderForm.jsp
│ │ ├── Product.jsp
│ │ ├── SearchProducts.jsp
│ │ ├── ShippingForm.jsp
│ │ ├── SignonForm.jsp
│ │ ├── ViewOrder.jsp
│ │ └── index.jsp
├── log4j.properties
├── mail.properties
├── petstore-servlet.xml
├── remoting-servlet.xml
├── server-config.wsdd
├── struts-config.xml
└── web.xml
├── help.html
├── images
├── banner_birds.gif
├── banner_cats.gif
├── banner_dogs.gif
├── banner_fish.gif
├── banner_reptiles.gif
├── bird1.gif
├── bird1.jpg
├── bird2.gif
├── bird2.jpg
├── bird3.gif
├── bird4.gif
├── bird5.gif
├── bird6.gif
├── birds_icon.gif
├── bkg-sidebar.gif
├── bkg-topbar.gif
├── button_add_to_cart.gif
├── button_checkout.gif
├── button_continue.gif
├── button_next.gif
├── button_prev.gif
├── button_previous.gif
├── button_proceed.gif
├── button_register_now.gif
├── button_remove.gif
├── button_submit.gif
├── button_update_cart.gif
├── cart.gif
├── cartHL.gif
├── cat1.gif
├── cat1.jpg
├── cat2.gif
├── cat2.jpg
├── cat3.gif
├── cat4.gif
├── cats_icon.gif
├── dog1.gif
├── dog1.jpg
├── dog2.gif
├── dog2.jpg
├── dog3.gif
├── dog3.jpg
├── dog4.gif
├── dog4.jpg
├── dog5.gif
├── dog5.jpg
├── dog6.gif
├── dog6.jpg
├── dogs.gif
├── dogs_icon.gif
├── fish.gif
├── fish1.gif
├── fish1.jpg
├── fish2.gif
├── fish2.jpg
├── fish3.gif
├── fish3.jpg
├── fish4.gif
├── fish4.jpg
├── fish_icon.gif
├── help.gif
├── helpHL.gif
├── lizard1.gif
├── lizard1.jpg
├── lizard2.gif
├── lizard3.gif
├── logo-topbar.gif
├── my_account.gif
├── my_accountHL.gif
├── poweredBySpring.gif
├── poweredby.gif
├── reptiles_icon.gif
├── search.gif
├── separator.gif
├── sign-in.gif
├── sign-inHL.gif
├── sign-out.gif
├── sign-outHL.gif
├── sm_birds.gif
├── sm_cats.gif
├── sm_dogs.gif
├── sm_fish.gif
├── sm_reptiles.gif
├── snake1.gif
├── snake1.jpg
└── splash.gif
└── index.html
/README.md:
--------------------------------------------------------------------------------
1 | # spring-sqlfire-samples is no longer actively maintained by VMware, Inc.
2 |
3 | # spring-sqlfire-samples
4 | Sample application using Spring and SQLFire
5 |
--------------------------------------------------------------------------------
/jpetstore/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/jpetstore/.gitignore:
--------------------------------------------------------------------------------
1 | /target/
2 |
--------------------------------------------------------------------------------
/jpetstore/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | jpetstore
4 |
5 |
6 |
7 |
8 |
9 | org.eclipse.wst.jsdt.core.javascriptValidator
10 |
11 |
12 |
13 |
14 | org.eclipse.wst.common.project.facet.core.builder
15 |
16 |
17 |
18 |
19 | org.eclipse.jdt.core.javabuilder
20 |
21 |
22 |
23 |
24 | org.eclipse.wst.validation.validationbuilder
25 |
26 |
27 |
28 |
29 | org.maven.ide.eclipse.maven2Builder
30 |
31 |
32 |
33 |
34 |
35 | org.eclipse.jem.workbench.JavaEMFNature
36 | org.eclipse.wst.common.modulecore.ModuleCoreNature
37 | org.eclipse.jdt.core.javanature
38 | org.maven.ide.eclipse.maven2Nature
39 | org.eclipse.wst.common.project.facet.core.nature
40 | org.eclipse.wst.jsdt.core.jsNature
41 |
42 |
43 |
--------------------------------------------------------------------------------
/jpetstore/.settings/.jsdtscope:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/jpetstore/.settings/com.springsource.sts.maven.prefs:
--------------------------------------------------------------------------------
1 | #Wed Aug 17 23:17:29 EEST 2011
2 | com.springsource.sts.maven.maven.automatically.update=true
3 | eclipse.preferences.version=1
4 |
--------------------------------------------------------------------------------
/jpetstore/.settings/org.eclipse.jdt.core.prefs:
--------------------------------------------------------------------------------
1 | #Thu May 28 18:03:52 EDT 2009
2 | eclipse.preferences.version=1
3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
4 | org.eclipse.jdt.core.compiler.compliance=1.5
5 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
6 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
7 | org.eclipse.jdt.core.compiler.source=1.5
8 |
--------------------------------------------------------------------------------
/jpetstore/.settings/org.eclipse.wst.common.component:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/jpetstore/.settings/org.eclipse.wst.common.project.facet.core.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/jpetstore/.settings/org.eclipse.wst.jsdt.ui.superType.container:
--------------------------------------------------------------------------------
1 | org.eclipse.wst.jsdt.launching.baseBrowserLibrary
--------------------------------------------------------------------------------
/jpetstore/.settings/org.eclipse.wst.jsdt.ui.superType.name:
--------------------------------------------------------------------------------
1 | Window
--------------------------------------------------------------------------------
/jpetstore/.settings/org.eclipse.wst.xml.core.prefs:
--------------------------------------------------------------------------------
1 | #Wed Jul 06 15:20:16 EEST 2011
2 | attributeHasNoValue=2
3 | eclipse.preferences.version=1
4 | endTagWithAttributes=2
5 | honourAllSchemaLocations=true
6 | indicateNoGrammar=1
7 | indiciateNoDocumentElement=-1
8 | markupValidation=true
9 | missingClosingBracket=2
10 | missingClosingQuote=2
11 | missingEndTag=2
12 | missingQuotes=2
13 | missingStartTag=1
14 | missingTagName=2
15 | namespaceInPITarget=2
16 | use-project-settings=true
17 | whitespaceAtStart=2
18 | whitespaceBeforeTagName=2
19 | xinclude=true
20 |
--------------------------------------------------------------------------------
/jpetstore/.settings/org.maven.ide.eclipse.prefs:
--------------------------------------------------------------------------------
1 | #Wed Aug 17 22:55:39 EEST 2011
2 | activeProfiles=
3 | eclipse.preferences.version=1
4 | fullBuildGoals=process-test-resources
5 | includeModules=false
6 | resolveWorkspaceProjects=false
7 | resourceFilterGoals=process-resources resources\:testResources
8 | skipCompilerPlugin=true
9 | version=1
10 |
--------------------------------------------------------------------------------
/jpetstore/db/hsqldb/jpetstore.lck:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/db/hsqldb/jpetstore.lck
--------------------------------------------------------------------------------
/jpetstore/db/hsqldb/jpetstore.properties:
--------------------------------------------------------------------------------
1 | #HSQL Database Engine 1.8.0.5
2 | #Thu Jun 23 16:45:42 EEST 2011
3 | hsqldb.script_format=0
4 | runtime.gc_interval=0
5 | sql.enforce_strict_size=false
6 | hsqldb.cache_size_scale=10
7 | readonly=false
8 | hsqldb.nio_data_file=true
9 | hsqldb.cache_scale=14
10 | version=1.8.0
11 | hsqldb.default_table_type=memory
12 | hsqldb.cache_file_scale=1
13 | hsqldb.log_size=200
14 | modified=yes
15 | hsqldb.cache_version=1.7.0
16 | hsqldb.original_version=1.7.1
17 | hsqldb.compatible_version=1.8.0
18 |
--------------------------------------------------------------------------------
/jpetstore/db/hsqldb/manager.bat:
--------------------------------------------------------------------------------
1 | mvn -f %~dp0pom-manager.xml exec:java
2 |
3 |
--------------------------------------------------------------------------------
/jpetstore/db/hsqldb/manager.sh:
--------------------------------------------------------------------------------
1 | cd `dirname $0`
2 | mvn -e -f pom-manager.xml exec:java
3 |
--------------------------------------------------------------------------------
/jpetstore/db/hsqldb/pom-manager.xml:
--------------------------------------------------------------------------------
1 |
5 |
8 | 4.0.0
9 | org.springframework.samples.jpetstore
10 | org.springframework.samples.jpetstore.hsqldb.manager
11 | org.springframework.samples.jpetstore.hsqldb
12 | 1.0.0-SNAPSHOT
13 |
14 |
15 |
16 | hsqldb
17 | hsqldb
18 | 1.8.0.7
19 |
20 |
21 |
22 |
23 |
24 |
25 | org.codehaus.mojo
26 | exec-maven-plugin
27 |
28 |
29 |
30 | java
31 |
32 |
33 |
34 |
35 | org.hsqldb.util.DatabaseManager
36 |
37 | --url
38 | jdbc:hsqldb:hsql://localhost:9002
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/jpetstore/db/hsqldb/pom.xml:
--------------------------------------------------------------------------------
1 |
4 | 4.0.0
5 | org.springframework.samples.jpetstore
6 | org.springframework.samples.jpetstore.hsqldb.server
7 | org.springframework.samples.jpetstore.hsqldb
8 | 1.0.0-SNAPSHOT
9 |
10 |
11 |
12 | hsqldb
13 | hsqldb
14 | 1.8.0.7
15 |
16 |
17 |
18 |
19 |
20 |
21 | org.codehaus.mojo
22 | exec-maven-plugin
23 |
24 |
25 |
26 | java
27 |
28 |
29 |
30 |
31 | org.hsqldb.Server
32 |
33 | -database
34 | ${db.file}
35 | -port
36 | 9002
37 | -trace
38 | true
39 |
40 |
41 |
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/jpetstore/db/hsqldb/server.bat:
--------------------------------------------------------------------------------
1 | mvn -f %~dp0pom.xml -Ddb.file=%~dp0jpetstore exec:java
2 |
--------------------------------------------------------------------------------
/jpetstore/db/hsqldb/server.properties:
--------------------------------------------------------------------------------
1 | server.port=9002
2 | server.trace=true
3 |
--------------------------------------------------------------------------------
/jpetstore/db/hsqldb/server.sh:
--------------------------------------------------------------------------------
1 | cd `dirname $0`
2 | mvn -e -Ddb.file=./jpetstore exec:java
3 |
--------------------------------------------------------------------------------
/jpetstore/db/mysql/jpetstore-mysql-schema.sql:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/db/mysql/jpetstore-mysql-schema.sql
--------------------------------------------------------------------------------
/jpetstore/db/oracle/jpetstore-oracle-schema-xa2.sql:
--------------------------------------------------------------------------------
1 | drop sequence linenum;
2 | drop sequence ordernum;
3 |
4 | drop table lineitem;
5 | drop table orderstatus;
6 | drop table orders;
7 |
8 | create table orders (
9 | orderid int not null,
10 | userid varchar(80) not null,
11 | orderdate date not null,
12 | shipaddr1 varchar(80) not null,
13 | shipaddr2 varchar(80) null,
14 | shipcity varchar(80) not null,
15 | shipstate varchar(80) not null,
16 | shipzip varchar(20) not null,
17 | shipcountry varchar(20) not null,
18 | billaddr1 varchar(80) not null,
19 | billaddr2 varchar(80) null,
20 | billcity varchar(80) not null,
21 | billstate varchar(80) not null,
22 | billzip varchar(20) not null,
23 | billcountry varchar(20) not null,
24 | courier varchar(80) not null,
25 | totalprice number(10,2) not null,
26 | billtofirstname varchar(80) not null,
27 | billtolastname varchar(80) not null,
28 | shiptofirstname varchar(80) not null,
29 | shiptolastname varchar(80) not null,
30 | creditcard varchar(80) not null,
31 | exprdate varchar(7) not null,
32 | cardtype varchar(80) not null,
33 | locale varchar(80) not null,
34 | constraint pk_orders primary key (orderid)
35 | );
36 |
37 | grant all on orders to public;
38 | create sequence ordernum increment by 1 cache 10000;
39 |
40 | create table orderstatus (
41 | orderid int not null,
42 | linenum int not null,
43 | timestamp date not null,
44 | status varchar(2) not null,
45 | constraint pk_orderstatus primary key (orderid, linenum),
46 | constraint fk_orderstatus_1 foreign key (orderid)
47 | references orders (orderid)
48 | );
49 |
50 | grant all on orderstatus to public;
51 | create sequence linenum increment by 1 cache 10000;
52 |
53 | create table lineitem (
54 | orderid int not null,
55 | linenum int not null,
56 | itemid varchar(10) not null,
57 | quantity int not null,
58 | unitprice number(10,2) not null,
59 | constraint pk_lineitem primary key (orderid, linenum),
60 | constraint fk_lineitem_1 foreign key (orderid)
61 | references orders (orderid)
62 | );
63 |
64 | grant all on lineitem to public;
65 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/dao/AccountDao.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.dao;
2 |
3 | import java.util.List;
4 |
5 | import org.springframework.dao.DataAccessException;
6 | import org.springframework.samples.jpetstore.domain.Account;
7 |
8 | public interface AccountDao {
9 |
10 | Account getAccount(String username) throws DataAccessException;
11 |
12 | Account getAccount(String username, String password) throws DataAccessException;
13 |
14 | void insertAccount(Account account) throws DataAccessException;
15 |
16 | void updateAccount(Account account) throws DataAccessException;
17 |
18 | List getUsernameList() throws DataAccessException;
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/dao/CategoryDao.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.dao;
2 |
3 | import java.util.List;
4 |
5 | import org.springframework.dao.DataAccessException;
6 | import org.springframework.samples.jpetstore.domain.Category;
7 |
8 | public interface CategoryDao {
9 |
10 | List getCategoryList() throws DataAccessException;
11 |
12 | Category getCategory(String categoryId) throws DataAccessException;
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/dao/ItemDao.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.dao;
2 |
3 | import java.util.List;
4 |
5 | import org.springframework.dao.DataAccessException;
6 | import org.springframework.samples.jpetstore.domain.Item;
7 | import org.springframework.samples.jpetstore.domain.Order;
8 |
9 | public interface ItemDao {
10 |
11 | public void updateQuantity(Order order) throws DataAccessException;
12 |
13 | boolean isItemInStock(String itemId) throws DataAccessException;
14 |
15 | List getItemListByProduct(String productId) throws DataAccessException;
16 |
17 | Item getItem(String itemId) throws DataAccessException;
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/dao/OrderDao.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.dao;
2 |
3 | import java.util.List;
4 |
5 | import org.springframework.dao.DataAccessException;
6 | import org.springframework.samples.jpetstore.domain.Order;
7 |
8 | public interface OrderDao {
9 |
10 | List getOrdersByUsername(String username) throws DataAccessException;
11 |
12 | Order getOrder(int orderId) throws DataAccessException;
13 |
14 | void insertOrder(Order order) throws DataAccessException;
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/dao/ProductDao.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.dao;
2 |
3 | import java.util.List;
4 |
5 | import org.springframework.dao.DataAccessException;
6 | import org.springframework.samples.jpetstore.domain.Product;
7 |
8 | public interface ProductDao {
9 |
10 | List getProductListByCategory(String categoryId) throws DataAccessException;
11 |
12 | List searchProductList(String keywords) throws DataAccessException;
13 |
14 | Product getProduct(String productId) throws DataAccessException;
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/dao/springdata/SpringDataCategoryDao.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.dao.springdata;
2 |
3 | import java.util.List;
4 |
5 | import javax.sql.DataSource;
6 |
7 | import org.springframework.dao.DataAccessException;
8 | import org.springframework.data.jdbc.query.QueryDslJdbcTemplate;
9 | import org.springframework.jdbc.core.BeanPropertyRowMapper;
10 | import org.springframework.samples.jpetstore.dao.CategoryDao;
11 | import org.springframework.samples.jpetstore.domain.Category;
12 | import org.springframework.samples.jpetstore.generated.domain.QCategory;
13 |
14 | import com.mysema.query.Tuple;
15 | import com.mysema.query.sql.SQLQuery;
16 | import com.mysema.query.types.Expression;
17 | import com.mysema.query.types.MappingProjection;
18 |
19 | public class SpringDataCategoryDao implements CategoryDao {
20 |
21 | private QueryDslJdbcTemplate template;
22 |
23 | private final QCategory qCategory = QCategory.category;
24 |
25 | public void setDataSource(DataSource dataSource) {
26 | this.template = new QueryDslJdbcTemplate(dataSource);
27 | }
28 |
29 | public List getCategoryList() throws DataAccessException {
30 | SQLQuery sqlQuery = template.newSqlQuery()
31 | .from(qCategory);
32 |
33 | return template.query(sqlQuery, new MappingCategoryProjection(qCategory.all()));
34 | }
35 |
36 | public Category getCategory(String categoryId) throws DataAccessException {
37 | SQLQuery sqlQuery = template.newSqlQuery()
38 | .from(qCategory)
39 | .where(qCategory.catid.eq(categoryId));
40 |
41 | return template.queryForObject(sqlQuery, new MappingCategoryProjection(qCategory.all()));
42 | }
43 |
44 | private class MappingCategoryProjection extends MappingProjection {
45 |
46 | public MappingCategoryProjection(Expression>... args) {
47 | super(Category.class, args);
48 | }
49 |
50 | @Override
51 | protected Category map(Tuple tuple) {
52 | Category category = new Category();
53 |
54 | category.setCategoryId(tuple.get(qCategory.catid));
55 | category.setDescription(tuple.get(qCategory.descn));
56 | category.setName(tuple.get(qCategory.name));
57 |
58 | return category;
59 | }
60 |
61 |
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/dao/springdata/SpringDataSequenceDao.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.dao.springdata;
2 |
3 | import javax.sql.DataSource;
4 |
5 | import org.springframework.dao.DataAccessException;
6 | import org.springframework.dao.DataRetrievalFailureException;
7 | import org.springframework.data.jdbc.query.QueryDslJdbcTemplate;
8 | import org.springframework.data.jdbc.query.SqlUpdateCallback;
9 | import org.springframework.samples.jpetstore.domain.Sequence;
10 | import org.springframework.samples.jpetstore.generated.domain.QSequence;
11 |
12 | import com.mysema.query.Tuple;
13 | import com.mysema.query.sql.SQLQuery;
14 | import com.mysema.query.sql.dml.SQLUpdateClause;
15 | import com.mysema.query.types.Expression;
16 | import com.mysema.query.types.MappingProjection;
17 |
18 | public class SpringDataSequenceDao {
19 |
20 | private final QSequence qSequence = QSequence.sequence;
21 |
22 | private QueryDslJdbcTemplate template;
23 |
24 | public void setDataSource(DataSource dataSource) {
25 | this.template = new QueryDslJdbcTemplate(dataSource);
26 | }
27 |
28 | /**
29 | * This is a generic sequence ID generator that is based on a database table
30 | * called 'SEQUENCE', which contains two columns (NAME, NEXTID). This
31 | * approach should work with any database.
32 | *
33 | * @param name
34 | * the name of the sequence
35 | * @return the next ID
36 | */
37 | public int getNextId(final String name) throws DataAccessException {
38 | SQLQuery sqlQuery = template.newSqlQuery()
39 | .from(qSequence)
40 | .where(qSequence.name.eq(name));
41 | final Sequence sequence = template.queryForObject(sqlQuery,
42 | new MappingSequenceProjection(qSequence.name, qSequence.nextid));
43 |
44 | if (sequence == null) {
45 | throw new DataRetrievalFailureException(
46 | "Could not get next value of sequence '" + name
47 | + "': sequence does not exist");
48 | }
49 |
50 | template.update(qSequence, new SqlUpdateCallback() {
51 | public long doInSqlUpdateClause(SQLUpdateClause sqlUpdateClause) {
52 | return sqlUpdateClause.where(qSequence.name.eq(name))
53 | .set(qSequence.nextid, sequence.getNextId() + 1)
54 | .execute();
55 | }
56 | });
57 |
58 | return sequence.getNextId();
59 | }
60 |
61 | private class MappingSequenceProjection extends MappingProjection {
62 |
63 | public MappingSequenceProjection(Expression>... args) {
64 | super(Sequence.class, args);
65 | }
66 |
67 | @Override
68 | protected Sequence map(Tuple tuple) {
69 | Sequence sequence = new Sequence();
70 |
71 | sequence.setName(tuple.get(qSequence.name));
72 | sequence.setNextId(tuple.get(qSequence.nextid));
73 |
74 | return sequence;
75 | }
76 |
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/domain/Cart.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.domain;
2 |
3 | import java.io.Serializable;
4 | import java.util.Collections;
5 | import java.util.HashMap;
6 | import java.util.Iterator;
7 | import java.util.Map;
8 |
9 | import org.springframework.beans.support.PagedListHolder;
10 |
11 | public class Cart implements Serializable {
12 |
13 | /* Private Fields */
14 |
15 | private final Map itemMap = Collections.synchronizedMap(new HashMap());
16 |
17 | private final PagedListHolder itemList = new PagedListHolder();
18 |
19 | /* JavaBeans Properties */
20 |
21 | public Cart() {
22 | this.itemList.setPageSize(4);
23 | }
24 |
25 | public Iterator getAllCartItems() { return itemList.getSource().iterator(); }
26 | public PagedListHolder getCartItemList() { return itemList; }
27 | public int getNumberOfItems() { return itemList.getSource().size(); }
28 |
29 | /* Public Methods */
30 |
31 | public boolean containsItemId(String itemId) {
32 | return itemMap.containsKey(itemId);
33 | }
34 |
35 | public void addItem(Item item, boolean isInStock) {
36 | CartItem cartItem = (CartItem) itemMap.get(item.getItemId());
37 | if (cartItem == null) {
38 | cartItem = new CartItem();
39 | cartItem.setItem(item);
40 | cartItem.setQuantity(0);
41 | cartItem.setInStock(isInStock);
42 | itemMap.put(item.getItemId(), cartItem);
43 | itemList.getSource().add(cartItem);
44 | }
45 | cartItem.incrementQuantity();
46 | }
47 |
48 |
49 | public Item removeItemById(String itemId) {
50 | CartItem cartItem = (CartItem) itemMap.remove(itemId);
51 | if (cartItem == null) {
52 | return null;
53 | }
54 | else {
55 | itemList.getSource().remove(cartItem);
56 | return cartItem.getItem();
57 | }
58 | }
59 |
60 | public void incrementQuantityByItemId(String itemId) {
61 | CartItem cartItem = (CartItem) itemMap.get(itemId);
62 | cartItem.incrementQuantity();
63 | }
64 |
65 | public void setQuantityByItemId(String itemId, int quantity) {
66 | CartItem cartItem = (CartItem) itemMap.get(itemId);
67 | cartItem.setQuantity(quantity);
68 | }
69 |
70 | public double getSubTotal() {
71 | double subTotal = 0;
72 | Iterator items = getAllCartItems();
73 | while (items.hasNext()) {
74 | CartItem cartItem = (CartItem) items.next();
75 | Item item = cartItem.getItem();
76 | double listPrice = item.getListPrice();
77 | int quantity = cartItem.getQuantity();
78 | subTotal += listPrice * quantity;
79 | }
80 | return subTotal;
81 | }
82 |
83 | }
84 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/domain/CartItem.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.domain;
2 |
3 | import java.io.Serializable;
4 |
5 | public class CartItem implements Serializable {
6 |
7 | /* Private Fields */
8 |
9 | private Item item;
10 | private int quantity;
11 | private boolean inStock;
12 |
13 | /* JavaBeans Properties */
14 |
15 | public boolean isInStock() { return inStock; }
16 | public void setInStock(boolean inStock) { this.inStock = inStock; }
17 |
18 | public Item getItem() { return item; }
19 | public void setItem(Item item) {
20 | this.item = item;
21 | }
22 |
23 | public int getQuantity() { return quantity; }
24 | public void setQuantity(int quantity) {
25 | this.quantity = quantity;
26 | }
27 |
28 | public double getTotalPrice() {
29 | if (item != null) {
30 | return item.getListPrice() * quantity;
31 | }
32 | else {
33 | return 0;
34 | }
35 | }
36 |
37 | /* Public methods */
38 |
39 | public void incrementQuantity() {
40 | quantity++;
41 | }
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/domain/Category.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.domain;
2 |
3 | import java.io.Serializable;
4 |
5 |
6 | public class Category implements Serializable {
7 |
8 | /* Private Fields */
9 |
10 | private String categoryId;
11 | private String name;
12 | private String description;
13 |
14 | /* JavaBeans Properties */
15 |
16 | public String getCategoryId() { return categoryId; }
17 | public void setCategoryId(String categoryId) { this.categoryId = categoryId.trim(); }
18 |
19 | public String getName() { return name; }
20 | public void setName(String name) { this.name = name; }
21 |
22 | public String getDescription() { return description; }
23 | public void setDescription(String description) { this.description = description; }
24 |
25 | /* Public Methods */
26 |
27 | public String toString() {
28 | return getCategoryId();
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/domain/Item.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.domain;
2 |
3 | import java.io.Serializable;
4 |
5 |
6 | public class Item implements Serializable {
7 |
8 | /* Private Fields */
9 |
10 | private String itemId;
11 | private String productId;
12 | private double listPrice;
13 | private double unitCost;
14 | private int supplierId;
15 | private String status;
16 | private String attribute1;
17 | private String attribute2;
18 | private String attribute3;
19 | private String attribute4;
20 | private String attribute5;
21 | private Product product;
22 | private int quantity;
23 |
24 | /* JavaBeans Properties */
25 |
26 | public String getItemId() { return itemId; }
27 | public void setItemId(String itemId) { this.itemId = itemId.trim(); }
28 |
29 | public int getQuantity() { return quantity; }
30 | public void setQuantity(int quantity) { this.quantity = quantity; }
31 |
32 | public Product getProduct() { return product; }
33 | public void setProduct(Product product) { this.product = product; }
34 |
35 | public String getProductId() { return productId; }
36 | public void setProductId(String productId) { this.productId = productId; }
37 |
38 | public int getSupplierId() { return supplierId; }
39 | public void setSupplierId(int supplierId) { this.supplierId = supplierId; }
40 |
41 | public double getListPrice() { return listPrice; }
42 | public void setListPrice(double listPrice) { this.listPrice = listPrice; }
43 |
44 | public double getUnitCost() { return unitCost; }
45 | public void setUnitCost(double unitCost) { this.unitCost = unitCost; }
46 |
47 | public String getStatus() { return status; }
48 | public void setStatus(String status) { this.status = status; }
49 |
50 | public String getAttribute1() { return attribute1; }
51 | public void setAttribute1(String attribute1) { this.attribute1 = attribute1; }
52 |
53 | public String getAttribute2() { return attribute2; }
54 | public void setAttribute2(String attribute2) { this.attribute2 = attribute2; }
55 |
56 | public String getAttribute3() { return attribute3; }
57 | public void setAttribute3(String attribute3) { this.attribute3 = attribute3; }
58 |
59 | public String getAttribute4() { return attribute4; }
60 | public void setAttribute4(String attribute4) { this.attribute4 = attribute4; }
61 |
62 | public String getAttribute5() { return attribute5; }
63 | public void setAttribute5(String attribute5) { this.attribute5 = attribute5; }
64 |
65 | /* Public Methods */
66 |
67 | public String toString() {
68 | return "(" + getItemId().trim() + "-" + getProductId().trim() + ")";
69 | }
70 |
71 | }
72 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/domain/LineItem.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.domain;
2 |
3 | import java.io.Serializable;
4 |
5 | public class LineItem implements Serializable {
6 |
7 | /* Private Fields */
8 |
9 | private int orderId;
10 | private int lineNumber;
11 | private int quantity;
12 | private String itemId;
13 | private double unitPrice;
14 | private Item item;
15 |
16 | /* Constructors */
17 |
18 | public LineItem() {
19 | }
20 |
21 | public LineItem(int lineNumber, CartItem cartItem) {
22 | this.lineNumber = lineNumber;
23 | this.quantity = cartItem.getQuantity();
24 | this.itemId = cartItem.getItem().getItemId();
25 | this.unitPrice = cartItem.getItem().getListPrice();
26 | this.item = cartItem.getItem();
27 | }
28 |
29 | /* JavaBeans Properties */
30 |
31 | public int getOrderId() { return orderId; }
32 | public void setOrderId(int orderId) { this.orderId = orderId; }
33 |
34 | public int getLineNumber() { return lineNumber; }
35 | public void setLineNumber(int lineNumber) { this.lineNumber = lineNumber; }
36 |
37 | public String getItemId() { return itemId; }
38 | public void setItemId(String itemId) { this.itemId = itemId; }
39 |
40 | public double getUnitPrice() { return unitPrice; }
41 | public void setUnitPrice(double unitprice) { this.unitPrice = unitprice; }
42 |
43 | public Item getItem() { return item; }
44 | public void setItem(Item item) {
45 | this.item = item;
46 | }
47 |
48 | public int getQuantity() { return quantity; }
49 | public void setQuantity(int quantity) {
50 | this.quantity = quantity;
51 | }
52 |
53 | public double getTotalPrice() {
54 | return this.unitPrice * this.quantity;
55 | }
56 |
57 | }
58 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/domain/Product.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.domain;
2 |
3 | import java.io.Serializable;
4 |
5 |
6 | public class Product implements Serializable {
7 |
8 | /* Private Fields */
9 |
10 | private String productId;
11 | private String categoryId;
12 | private String name;
13 | private String description;
14 |
15 | /* JavaBeans Properties */
16 |
17 | public String getProductId() { return productId; }
18 | public void setProductId(String productId) { this.productId = productId.trim(); }
19 |
20 | public String getCategoryId() { return categoryId; }
21 | public void setCategoryId(String categoryId) { this.categoryId = categoryId; }
22 |
23 | public String getName() { return name; }
24 | public void setName(String name) { this.name = name; }
25 |
26 | public String getDescription() { return description; }
27 | public void setDescription(String description) { this.description = description; }
28 |
29 | /* Public Methods*/
30 |
31 | public String toString() {
32 | return getName();
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/domain/Sequence.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.domain;
2 |
3 | import java.io.Serializable;
4 |
5 | public class Sequence implements Serializable {
6 |
7 | /* Private Fields */
8 |
9 | private String name;
10 | private int nextId;
11 |
12 | /* Constructors */
13 |
14 | public Sequence() {
15 | }
16 |
17 | public Sequence(String name, int nextId) {
18 | this.name = name;
19 | this.nextId = nextId;
20 | }
21 |
22 | /* JavaBeans Properties */
23 |
24 | public String getName() { return name; }
25 | public void setName(String name) { this.name = name; }
26 |
27 | public int getNextId() { return nextId; }
28 | public void setNextId(int nextId) { this.nextId = nextId; }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/domain/logic/AccountValidator.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.domain.logic;
2 |
3 | import org.springframework.samples.jpetstore.domain.Account;
4 | import org.springframework.validation.Errors;
5 | import org.springframework.validation.ValidationUtils;
6 | import org.springframework.validation.Validator;
7 |
8 | /**
9 | * @author Juergen Hoeller
10 | * @since 01.12.2003
11 | */
12 | public class AccountValidator implements Validator {
13 |
14 | public boolean supports(Class clazz) {
15 | return Account.class.isAssignableFrom(clazz);
16 | }
17 |
18 | public void validate(Object obj, Errors errors) {
19 | ValidationUtils.rejectIfEmpty(errors, "firstName", "FIRST_NAME_REQUIRED", "First name is required.");
20 | ValidationUtils.rejectIfEmpty(errors, "lastName", "LAST_NAME_REQUIRED", "Last name is required.");
21 | ValidationUtils.rejectIfEmpty(errors, "email", "EMAIL_REQUIRED", "Email address is required.");
22 | ValidationUtils.rejectIfEmpty(errors, "phone", "PHONE_REQUIRED", "Phone number is required.");
23 | ValidationUtils.rejectIfEmpty(errors, "address1", "ADDRESS_REQUIRED", "Address (1) is required.");
24 | ValidationUtils.rejectIfEmpty(errors, "city", "CITY_REQUIRED", "City is required.");
25 | ValidationUtils.rejectIfEmpty(errors, "state", "STATE_REQUIRED", "State is required.");
26 | ValidationUtils.rejectIfEmpty(errors, "zip", "ZIP_REQUIRED", "ZIP is required.");
27 | ValidationUtils.rejectIfEmpty(errors, "country", "COUNTRY_REQUIRED", "Country is required.");
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/domain/logic/OrderService.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.domain.logic;
2 |
3 | import org.springframework.samples.jpetstore.domain.Order;
4 |
5 | /**
6 | * Separate OrderService interface, implemented by PetStoreImpl
7 | * in addition to PetStoreFacade.
8 | *
9 | * Mainly targeted at usage as remote service interface,
10 | * just exposing the getOrder
method.
11 | *
12 | * @author Juergen Hoeller
13 | * @since 26.12.2003
14 | * @see PetStoreFacade
15 | * @see PetStoreImpl
16 | * @see org.springframework.samples.jpetstore.service.JaxRpcOrderService
17 | */
18 | public interface OrderService {
19 |
20 | Order getOrder(int orderId);
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/domain/logic/PetStoreFacade.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.domain.logic;
2 |
3 | import java.util.List;
4 |
5 | import org.springframework.samples.jpetstore.domain.Account;
6 | import org.springframework.samples.jpetstore.domain.Category;
7 | import org.springframework.samples.jpetstore.domain.Item;
8 | import org.springframework.samples.jpetstore.domain.Order;
9 | import org.springframework.samples.jpetstore.domain.Product;
10 |
11 | /**
12 | * JPetStore's central business interface.
13 | *
14 | * @author Juergen Hoeller
15 | * @since 30.11.2003
16 | */
17 | public interface PetStoreFacade {
18 |
19 | Account getAccount(String username);
20 |
21 | Account getAccount(String username, String password);
22 |
23 | void insertAccount(Account account);
24 |
25 | void updateAccount(Account account);
26 |
27 | List getUsernameList();
28 |
29 |
30 | List getCategoryList();
31 |
32 | Category getCategory(String categoryId);
33 |
34 |
35 | List getProductListByCategory(String categoryId);
36 |
37 | List searchProductList(String keywords);
38 |
39 | Product getProduct(String productId);
40 |
41 |
42 | List getItemListByProduct(String productId);
43 |
44 | Item getItem(String itemId);
45 |
46 | boolean isItemInStock(String itemId);
47 |
48 |
49 | void insertOrder(Order order);
50 |
51 | Order getOrder(int orderId);
52 |
53 | List getOrdersByUsername(String username);
54 |
55 | }
56 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/domain/logic/SendOrderConfirmationEmailAdvice.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.domain.logic;
2 |
3 | import java.lang.reflect.Method;
4 |
5 | import org.apache.commons.logging.Log;
6 | import org.apache.commons.logging.LogFactory;
7 |
8 | import org.springframework.aop.AfterReturningAdvice;
9 | import org.springframework.beans.factory.InitializingBean;
10 | import org.springframework.mail.MailException;
11 | import org.springframework.mail.MailSender;
12 | import org.springframework.mail.SimpleMailMessage;
13 | import org.springframework.samples.jpetstore.domain.Account;
14 | import org.springframework.samples.jpetstore.domain.Order;
15 |
16 | /**
17 | * AOP advice that sends confirmation email after order has been submitted
18 | * @author Dmitriy Kopylenko
19 | */
20 | public class SendOrderConfirmationEmailAdvice implements AfterReturningAdvice, InitializingBean {
21 |
22 | private static final String DEFAULT_MAIL_FROM = "jpetstore@springframework.org";
23 |
24 | private static final String DEFAULT_SUBJECT = "Thank you for your order!";
25 |
26 | private final Log logger = LogFactory.getLog(getClass());
27 |
28 | private MailSender mailSender;
29 |
30 | private String mailFrom = DEFAULT_MAIL_FROM;
31 |
32 | private String subject = DEFAULT_SUBJECT;
33 |
34 | public void setMailSender(MailSender mailSender) {
35 | this.mailSender = mailSender;
36 | }
37 |
38 | public void setMailFrom(String mailFrom) {
39 | this.mailFrom = mailFrom;
40 | }
41 |
42 | public void setSubject(String subject) {
43 | this.subject = subject;
44 | }
45 |
46 | public void afterPropertiesSet() throws Exception {
47 | if (this.mailSender == null) {
48 | throw new IllegalStateException("mailSender is required");
49 | }
50 | }
51 |
52 | public void afterReturning(Object returnValue, Method m, Object[] args, Object target) throws Throwable {
53 | Order order = (Order) args[0];
54 | Account account = ((PetStoreFacade) target).getAccount(order.getUsername());
55 |
56 | // don't do anything if email address is not set
57 | if (account.getEmail() == null || account.getEmail().length() == 0) {
58 | return;
59 | }
60 |
61 | StringBuffer text = new StringBuffer();
62 | text.append("Dear ").append(account.getFirstName()).append(' ').append(account.getLastName());
63 | text.append(", thank your for your order from JPetStore. Please note that your order number is ");
64 | text.append(order.getOrderId());
65 |
66 | SimpleMailMessage mailMessage = new SimpleMailMessage();
67 | mailMessage.setTo(account.getEmail());
68 | mailMessage.setFrom(this.mailFrom);
69 | mailMessage.setSubject(this.subject);
70 | mailMessage.setText(text.toString());
71 | try {
72 | this.mailSender.send(mailMessage);
73 | }
74 | catch (MailException ex) {
75 | // just log it and go on
76 | logger.warn("An exception occured when trying to send email", ex);
77 | }
78 | }
79 |
80 | }
81 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/generated/domain/QAccount.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.generated.domain;
2 |
3 | import static com.mysema.query.types.PathMetadataFactory.*;
4 |
5 | import com.mysema.query.types.path.*;
6 |
7 | import com.mysema.query.types.PathMetadata;
8 | import javax.annotation.Generated;
9 | import com.mysema.query.types.Path;
10 |
11 |
12 | /**
13 | * QAccount is a Querydsl query type for QAccount
14 | */
15 | @Generated("com.mysema.query.sql.codegen.MetaDataSerializer")
16 | public class QAccount extends com.mysema.query.sql.RelationalPathBase {
17 |
18 | private static final long serialVersionUID = 2061303545;
19 |
20 | public static final QAccount account = new QAccount("ACCOUNT");
21 |
22 | public final StringPath addr1 = createString("ADDR1");
23 |
24 | public final StringPath addr2 = createString("ADDR2");
25 |
26 | public final StringPath city = createString("CITY");
27 |
28 | public final StringPath country = createString("COUNTRY");
29 |
30 | public final StringPath email = createString("EMAIL");
31 |
32 | public final StringPath firstname = createString("FIRSTNAME");
33 |
34 | public final StringPath lastname = createString("LASTNAME");
35 |
36 | public final StringPath phone = createString("PHONE");
37 |
38 | public final StringPath state = createString("STATE");
39 |
40 | public final StringPath status = createString("STATUS");
41 |
42 | public final StringPath userid = createString("USERID");
43 |
44 | public final StringPath zip = createString("ZIP");
45 |
46 | public final com.mysema.query.sql.PrimaryKey accountPk = createPrimaryKey(userid);
47 |
48 | public QAccount(String variable) {
49 | super(QAccount.class, forVariable(variable), "APP", "ACCOUNT");
50 | }
51 |
52 | @SuppressWarnings("all")
53 | public QAccount(Path extends QAccount> path) {
54 | super((Class)path.getType(), path.getMetadata(), "APP", "ACCOUNT");
55 | }
56 |
57 | public QAccount(PathMetadata> metadata) {
58 | super(QAccount.class, metadata, "APP", "ACCOUNT");
59 | }
60 |
61 | }
62 |
63 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/generated/domain/QBannerdata.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.generated.domain;
2 |
3 | import static com.mysema.query.types.PathMetadataFactory.*;
4 |
5 | import com.mysema.query.types.path.*;
6 |
7 | import com.mysema.query.types.PathMetadata;
8 | import javax.annotation.Generated;
9 | import com.mysema.query.types.Path;
10 |
11 |
12 | /**
13 | * QBannerdata is a Querydsl query type for QBannerdata
14 | */
15 | @Generated("com.mysema.query.sql.codegen.MetaDataSerializer")
16 | public class QBannerdata extends com.mysema.query.sql.RelationalPathBase {
17 |
18 | private static final long serialVersionUID = -1376272246;
19 |
20 | public static final QBannerdata bannerdata = new QBannerdata("BANNERDATA");
21 |
22 | public final StringPath bannername = createString("BANNERNAME");
23 |
24 | public final StringPath favcategory = createString("FAVCATEGORY");
25 |
26 | public final com.mysema.query.sql.PrimaryKey bannerdataPk = createPrimaryKey(favcategory);
27 |
28 | public QBannerdata(String variable) {
29 | super(QBannerdata.class, forVariable(variable), "APP", "BANNERDATA");
30 | }
31 |
32 | @SuppressWarnings("all")
33 | public QBannerdata(Path extends QBannerdata> path) {
34 | super((Class)path.getType(), path.getMetadata(), "APP", "BANNERDATA");
35 | }
36 |
37 | public QBannerdata(PathMetadata> metadata) {
38 | super(QBannerdata.class, metadata, "APP", "BANNERDATA");
39 | }
40 |
41 | }
42 |
43 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/generated/domain/QCategory.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.generated.domain;
2 |
3 | import static com.mysema.query.types.PathMetadataFactory.*;
4 |
5 | import com.mysema.query.types.path.*;
6 |
7 | import com.mysema.query.types.PathMetadata;
8 | import javax.annotation.Generated;
9 | import com.mysema.query.types.Path;
10 |
11 |
12 | /**
13 | * QCategory is a Querydsl query type for QCategory
14 | */
15 | @Generated("com.mysema.query.sql.codegen.MetaDataSerializer")
16 | public class QCategory extends com.mysema.query.sql.RelationalPathBase {
17 |
18 | private static final long serialVersionUID = 1663558066;
19 |
20 | public static final QCategory category = new QCategory("CATEGORY");
21 |
22 | public final StringPath catid = createString("CATID");
23 |
24 | public final StringPath descn = createString("DESCN");
25 |
26 | public final StringPath name = createString("NAME");
27 |
28 | public final com.mysema.query.sql.PrimaryKey categoryPk = createPrimaryKey(catid);
29 |
30 | public final com.mysema.query.sql.ForeignKey _productcatFk = createInvForeignKey(catid, "CATEGORY");
31 |
32 | public QCategory(String variable) {
33 | super(QCategory.class, forVariable(variable), "APP", "CATEGORY");
34 | }
35 |
36 | @SuppressWarnings("all")
37 | public QCategory(Path extends QCategory> path) {
38 | super((Class)path.getType(), path.getMetadata(), "APP", "CATEGORY");
39 | }
40 |
41 | public QCategory(PathMetadata> metadata) {
42 | super(QCategory.class, metadata, "APP", "CATEGORY");
43 | }
44 |
45 | }
46 |
47 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/generated/domain/QInventory.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.generated.domain;
2 |
3 | import static com.mysema.query.types.PathMetadataFactory.*;
4 |
5 | import com.mysema.query.types.path.*;
6 |
7 | import com.mysema.query.types.PathMetadata;
8 | import javax.annotation.Generated;
9 | import com.mysema.query.types.Path;
10 |
11 |
12 | /**
13 | * QInventory is a Querydsl query type for QInventory
14 | */
15 | @Generated("com.mysema.query.sql.codegen.MetaDataSerializer")
16 | public class QInventory extends com.mysema.query.sql.RelationalPathBase {
17 |
18 | private static final long serialVersionUID = 739216168;
19 |
20 | public static final QInventory inventory = new QInventory("INVENTORY");
21 |
22 | public final StringPath itemid = createString("ITEMID");
23 |
24 | public final NumberPath qty = createNumber("QTY", Integer.class);
25 |
26 | public final com.mysema.query.sql.PrimaryKey inventoryPk = createPrimaryKey(itemid);
27 |
28 | public QInventory(String variable) {
29 | super(QInventory.class, forVariable(variable), "APP", "INVENTORY");
30 | }
31 |
32 | @SuppressWarnings("all")
33 | public QInventory(Path extends QInventory> path) {
34 | super((Class)path.getType(), path.getMetadata(), "APP", "INVENTORY");
35 | }
36 |
37 | public QInventory(PathMetadata> metadata) {
38 | super(QInventory.class, metadata, "APP", "INVENTORY");
39 | }
40 |
41 | }
42 |
43 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/generated/domain/QItem.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.generated.domain;
2 |
3 | import static com.mysema.query.types.PathMetadataFactory.*;
4 |
5 | import com.mysema.query.types.path.*;
6 |
7 | import com.mysema.query.types.PathMetadata;
8 | import javax.annotation.Generated;
9 | import com.mysema.query.types.Path;
10 |
11 |
12 | /**
13 | * QItem is a Querydsl query type for QItem
14 | */
15 | @Generated("com.mysema.query.sql.codegen.MetaDataSerializer")
16 | public class QItem extends com.mysema.query.sql.RelationalPathBase {
17 |
18 | private static final long serialVersionUID = -1184032313;
19 |
20 | public static final QItem item = new QItem("ITEM");
21 |
22 | public final StringPath attr1 = createString("ATTR1");
23 |
24 | public final StringPath attr2 = createString("ATTR2");
25 |
26 | public final StringPath attr3 = createString("ATTR3");
27 |
28 | public final StringPath attr4 = createString("ATTR4");
29 |
30 | public final StringPath attr5 = createString("ATTR5");
31 |
32 | public final StringPath itemid = createString("ITEMID");
33 |
34 | public final NumberPath listprice = createNumber("LISTPRICE", java.math.BigDecimal.class);
35 |
36 | public final StringPath productid = createString("PRODUCTID");
37 |
38 | public final StringPath status = createString("STATUS");
39 |
40 | public final NumberPath supplier = createNumber("SUPPLIER", Integer.class);
41 |
42 | public final NumberPath unitcost = createNumber("UNITCOST", java.math.BigDecimal.class);
43 |
44 | public final com.mysema.query.sql.PrimaryKey itemPk = createPrimaryKey(itemid);
45 |
46 | public final com.mysema.query.sql.ForeignKey itemsupFk = createForeignKey(supplier, "SUPPID");
47 |
48 | public final com.mysema.query.sql.ForeignKey itemprodFk = createForeignKey(productid, "PRODUCTID");
49 |
50 | public QItem(String variable) {
51 | super(QItem.class, forVariable(variable), "APP", "ITEM");
52 | }
53 |
54 | @SuppressWarnings("all")
55 | public QItem(Path extends QItem> path) {
56 | super((Class)path.getType(), path.getMetadata(), "APP", "ITEM");
57 | }
58 |
59 | public QItem(PathMetadata> metadata) {
60 | super(QItem.class, metadata, "APP", "ITEM");
61 | }
62 |
63 | }
64 |
65 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/generated/domain/QLineitem.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.generated.domain;
2 |
3 | import static com.mysema.query.types.PathMetadataFactory.*;
4 |
5 | import com.mysema.query.types.path.*;
6 |
7 | import com.mysema.query.types.PathMetadata;
8 | import javax.annotation.Generated;
9 | import com.mysema.query.types.Path;
10 |
11 |
12 | /**
13 | * QLineitem is a Querydsl query type for QLineitem
14 | */
15 | @Generated("com.mysema.query.sql.codegen.MetaDataSerializer")
16 | public class QLineitem extends com.mysema.query.sql.RelationalPathBase {
17 |
18 | private static final long serialVersionUID = -1492634181;
19 |
20 | public static final QLineitem lineitem = new QLineitem("LINEITEM");
21 |
22 | public final StringPath itemid = createString("ITEMID");
23 |
24 | public final NumberPath linenum = createNumber("LINENUM", Integer.class);
25 |
26 | public final NumberPath orderid = createNumber("ORDERID", Integer.class);
27 |
28 | public final NumberPath quantity = createNumber("QUANTITY", Integer.class);
29 |
30 | public final NumberPath unitprice = createNumber("UNITPRICE", java.math.BigDecimal.class);
31 |
32 | public final com.mysema.query.sql.PrimaryKey lineitemPk = createPrimaryKey(linenum, orderid);
33 |
34 | public QLineitem(String variable) {
35 | super(QLineitem.class, forVariable(variable), "APP", "LINEITEM");
36 | }
37 |
38 | @SuppressWarnings("all")
39 | public QLineitem(Path extends QLineitem> path) {
40 | super((Class)path.getType(), path.getMetadata(), "APP", "LINEITEM");
41 | }
42 |
43 | public QLineitem(PathMetadata> metadata) {
44 | super(QLineitem.class, metadata, "APP", "LINEITEM");
45 | }
46 |
47 | }
48 |
49 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/generated/domain/QOrderstatus.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.generated.domain;
2 |
3 | import static com.mysema.query.types.PathMetadataFactory.*;
4 |
5 | import com.mysema.query.types.path.*;
6 |
7 | import com.mysema.query.types.PathMetadata;
8 | import javax.annotation.Generated;
9 | import com.mysema.query.types.Path;
10 |
11 |
12 | /**
13 | * QOrderstatus is a Querydsl query type for QOrderstatus
14 | */
15 | @Generated("com.mysema.query.sql.codegen.MetaDataSerializer")
16 | public class QOrderstatus extends com.mysema.query.sql.RelationalPathBase {
17 |
18 | private static final long serialVersionUID = 439243660;
19 |
20 | public static final QOrderstatus orderstatus = new QOrderstatus("ORDERSTATUS");
21 |
22 | public final NumberPath linenum = createNumber("LINENUM", Integer.class);
23 |
24 | public final NumberPath orderid = createNumber("ORDERID", Integer.class);
25 |
26 | public final StringPath status = createString("STATUS");
27 |
28 | public final DatePath timestamp = createDate("TIMESTAMP", java.sql.Date.class);
29 |
30 | public final com.mysema.query.sql.PrimaryKey orderstatusPk = createPrimaryKey(linenum, orderid);
31 |
32 | public QOrderstatus(String variable) {
33 | super(QOrderstatus.class, forVariable(variable), "APP", "ORDERSTATUS");
34 | }
35 |
36 | @SuppressWarnings("all")
37 | public QOrderstatus(Path extends QOrderstatus> path) {
38 | super((Class)path.getType(), path.getMetadata(), "APP", "ORDERSTATUS");
39 | }
40 |
41 | public QOrderstatus(PathMetadata> metadata) {
42 | super(QOrderstatus.class, metadata, "APP", "ORDERSTATUS");
43 | }
44 |
45 | }
46 |
47 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/generated/domain/QProduct.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.generated.domain;
2 |
3 | import static com.mysema.query.types.PathMetadataFactory.*;
4 |
5 | import com.mysema.query.types.path.*;
6 |
7 | import com.mysema.query.types.PathMetadata;
8 | import javax.annotation.Generated;
9 | import com.mysema.query.types.Path;
10 |
11 |
12 | /**
13 | * QProduct is a Querydsl query type for QProduct
14 | */
15 | @Generated("com.mysema.query.sql.codegen.MetaDataSerializer")
16 | public class QProduct extends com.mysema.query.sql.RelationalPathBase {
17 |
18 | private static final long serialVersionUID = -1365818949;
19 |
20 | public static final QProduct product = new QProduct("PRODUCT");
21 |
22 | public final StringPath category = createString("CATEGORY");
23 |
24 | public final StringPath descn = createString("DESCN");
25 |
26 | public final StringPath name = createString("NAME");
27 |
28 | public final StringPath productid = createString("PRODUCTID");
29 |
30 | public final com.mysema.query.sql.PrimaryKey productPk = createPrimaryKey(productid);
31 |
32 | public final com.mysema.query.sql.ForeignKey productcatFk = createForeignKey(category, "CATID");
33 |
34 | public final com.mysema.query.sql.ForeignKey _itemprodFk = createInvForeignKey(productid, "PRODUCTID");
35 |
36 | public QProduct(String variable) {
37 | super(QProduct.class, forVariable(variable), "APP", "PRODUCT");
38 | }
39 |
40 | @SuppressWarnings("all")
41 | public QProduct(Path extends QProduct> path) {
42 | super((Class)path.getType(), path.getMetadata(), "APP", "PRODUCT");
43 | }
44 |
45 | public QProduct(PathMetadata> metadata) {
46 | super(QProduct.class, metadata, "APP", "PRODUCT");
47 | }
48 |
49 | }
50 |
51 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/generated/domain/QProfile.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.generated.domain;
2 |
3 | import static com.mysema.query.types.PathMetadataFactory.*;
4 |
5 | import com.mysema.query.types.path.*;
6 |
7 | import com.mysema.query.types.PathMetadata;
8 | import javax.annotation.Generated;
9 | import com.mysema.query.types.Path;
10 |
11 |
12 | /**
13 | * QProfile is a Querydsl query type for QProfile
14 | */
15 | @Generated("com.mysema.query.sql.codegen.MetaDataSerializer")
16 | public class QProfile extends com.mysema.query.sql.RelationalPathBase {
17 |
18 | private static final long serialVersionUID = -1365770635;
19 |
20 | public static final QProfile profile = new QProfile("PROFILE");
21 |
22 | public final NumberPath banneropt = createNumber("BANNEROPT", Short.class);
23 |
24 | public final StringPath favcategory = createString("FAVCATEGORY");
25 |
26 | public final StringPath langpref = createString("LANGPREF");
27 |
28 | public final NumberPath mylistopt = createNumber("MYLISTOPT", Short.class);
29 |
30 | public final StringPath userid = createString("USERID");
31 |
32 | public final com.mysema.query.sql.PrimaryKey profilePk = createPrimaryKey(userid);
33 |
34 | public QProfile(String variable) {
35 | super(QProfile.class, forVariable(variable), "APP", "PROFILE");
36 | }
37 |
38 | @SuppressWarnings("all")
39 | public QProfile(Path extends QProfile> path) {
40 | super((Class)path.getType(), path.getMetadata(), "APP", "PROFILE");
41 | }
42 |
43 | public QProfile(PathMetadata> metadata) {
44 | super(QProfile.class, metadata, "APP", "PROFILE");
45 | }
46 |
47 | }
48 |
49 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/generated/domain/QSequence.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.generated.domain;
2 |
3 | import static com.mysema.query.types.PathMetadataFactory.*;
4 |
5 | import com.mysema.query.types.path.*;
6 |
7 | import com.mysema.query.types.PathMetadata;
8 | import javax.annotation.Generated;
9 | import com.mysema.query.types.Path;
10 |
11 |
12 | /**
13 | * QSequence is a Querydsl query type for QSequence
14 | */
15 | @Generated("com.mysema.query.sql.codegen.MetaDataSerializer")
16 | public class QSequence extends com.mysema.query.sql.RelationalPathBase {
17 |
18 | private static final long serialVersionUID = -1332372363;
19 |
20 | public static final QSequence sequence = new QSequence("SEQUENCE");
21 |
22 | public final StringPath name = createString("NAME");
23 |
24 | public final NumberPath nextid = createNumber("NEXTID", Integer.class);
25 |
26 | public final com.mysema.query.sql.PrimaryKey sequencePk = createPrimaryKey(name);
27 |
28 | public QSequence(String variable) {
29 | super(QSequence.class, forVariable(variable), "APP", "SEQUENCE");
30 | }
31 |
32 | @SuppressWarnings("all")
33 | public QSequence(Path extends QSequence> path) {
34 | super((Class)path.getType(), path.getMetadata(), "APP", "SEQUENCE");
35 | }
36 |
37 | public QSequence(PathMetadata> metadata) {
38 | super(QSequence.class, metadata, "APP", "SEQUENCE");
39 | }
40 |
41 | }
42 |
43 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/generated/domain/QSignon.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.generated.domain;
2 |
3 | import static com.mysema.query.types.PathMetadataFactory.*;
4 |
5 | import com.mysema.query.types.path.*;
6 |
7 | import com.mysema.query.types.PathMetadata;
8 | import javax.annotation.Generated;
9 | import com.mysema.query.types.Path;
10 |
11 |
12 | /**
13 | * QSignon is a Querydsl query type for QSignon
14 | */
15 | @Generated("com.mysema.query.sql.codegen.MetaDataSerializer")
16 | public class QSignon extends com.mysema.query.sql.RelationalPathBase {
17 |
18 | private static final long serialVersionUID = 587477520;
19 |
20 | public static final QSignon signon = new QSignon("SIGNON");
21 |
22 | public final StringPath password = createString("PASSWORD");
23 |
24 | public final StringPath username = createString("USERNAME");
25 |
26 | public final com.mysema.query.sql.PrimaryKey signonPk = createPrimaryKey(username);
27 |
28 | public QSignon(String variable) {
29 | super(QSignon.class, forVariable(variable), "APP", "SIGNON");
30 | }
31 |
32 | @SuppressWarnings("all")
33 | public QSignon(Path extends QSignon> path) {
34 | super((Class)path.getType(), path.getMetadata(), "APP", "SIGNON");
35 | }
36 |
37 | public QSignon(PathMetadata> metadata) {
38 | super(QSignon.class, metadata, "APP", "SIGNON");
39 | }
40 |
41 | }
42 |
43 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/generated/domain/QSupplier.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.generated.domain;
2 |
3 | import static com.mysema.query.types.PathMetadataFactory.*;
4 |
5 | import com.mysema.query.types.path.*;
6 |
7 | import com.mysema.query.types.PathMetadata;
8 | import javax.annotation.Generated;
9 | import com.mysema.query.types.Path;
10 |
11 |
12 | /**
13 | * QSupplier is a Querydsl query type for QSupplier
14 | */
15 | @Generated("com.mysema.query.sql.codegen.MetaDataSerializer")
16 | public class QSupplier extends com.mysema.query.sql.RelationalPathBase {
17 |
18 | private static final long serialVersionUID = -50258304;
19 |
20 | public static final QSupplier supplier = new QSupplier("SUPPLIER");
21 |
22 | public final StringPath addr1 = createString("ADDR1");
23 |
24 | public final StringPath addr2 = createString("ADDR2");
25 |
26 | public final StringPath city = createString("CITY");
27 |
28 | public final StringPath name = createString("NAME");
29 |
30 | public final StringPath phone = createString("PHONE");
31 |
32 | public final StringPath state = createString("STATE");
33 |
34 | public final StringPath status = createString("STATUS");
35 |
36 | public final NumberPath suppid = createNumber("SUPPID", Integer.class);
37 |
38 | public final StringPath zip = createString("ZIP");
39 |
40 | public final com.mysema.query.sql.PrimaryKey supplierPk = createPrimaryKey(suppid);
41 |
42 | public final com.mysema.query.sql.ForeignKey _itemsupFk = createInvForeignKey(suppid, "SUPPLIER");
43 |
44 | public QSupplier(String variable) {
45 | super(QSupplier.class, forVariable(variable), "APP", "SUPPLIER");
46 | }
47 |
48 | @SuppressWarnings("all")
49 | public QSupplier(Path extends QSupplier> path) {
50 | super((Class)path.getType(), path.getMetadata(), "APP", "SUPPLIER");
51 | }
52 |
53 | public QSupplier(PathMetadata> metadata) {
54 | super(QSupplier.class, metadata, "APP", "SUPPLIER");
55 | }
56 |
57 | }
58 |
59 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/service/JaxRpcOrderService.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.service;
2 |
3 | import org.springframework.remoting.jaxrpc.ServletEndpointSupport;
4 | import org.springframework.samples.jpetstore.domain.Order;
5 | import org.springframework.samples.jpetstore.domain.logic.OrderService;
6 |
7 | /**
8 | * JAX-RPC OrderService endpoint that simply delegates to the OrderService
9 | * implementation in the root web application context. Implements the plain
10 | * OrderService interface as service interface, just like the target bean does.
11 | *
12 | * This proxy class is necessary because JAX-RPC/Axis requires a dedicated
13 | * endpoint class to instantiate. If an existing service needs to be exported,
14 | * a wrapper that extends ServletEndpointSupport for simple application context
15 | * access is the simplest JAX-RPC compliant way.
16 | *
17 | *
This is the class registered with the server-side JAX-RPC implementation.
18 | * In the case of Axis, this happens in "server-config.wsdd" respectively via
19 | * deployment calls. The Web Service tool manages the lifecycle of instances
20 | * of this class: A Spring application context can just be accessed here.
21 | *
22 | *
Note that this class does not implement an RMI port interface,
23 | * despite the JAX-RPC spec requiring this for service endpoints. Axis and
24 | * other JAX-RPC implementations are known to accept non-RMI endpoint classes
25 | * too, so there's no need to maintain an RMI port interface in addition to
26 | * the existing non-RMI service interface (OrderService).
27 | *
28 | *
If your JAX-RPC implementation imposes a strict requirement on a service
29 | * endpoint class to implement an RMI port interface, then let your endpoint
30 | * class implement both the non-RMI service interface and the RMI port interface.
31 | * This will work as long as the methods in both interfaces just differ in the
32 | * declared RemoteException. Of course, this unfortunately involves double
33 | * maintenance: one interface for your business logic, one for JAX-RPC.
34 | * Therefore, it is usually preferable to avoid this if not absolutely necessary.
35 | *
36 | * @author Juergen Hoeller
37 | * @since 26.12.2003
38 | */
39 | public class JaxRpcOrderService extends ServletEndpointSupport implements OrderService {
40 |
41 | private OrderService orderService;
42 |
43 | protected void onInit() {
44 | this.orderService = (OrderService) getWebApplicationContext().getBean("petStore");
45 | }
46 |
47 | public Order getOrder(int orderId) {
48 | return this.orderService.getOrder(orderId);
49 | }
50 |
51 | }
52 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/web/spring/AccountForm.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.web.spring;
2 |
3 | import java.io.Serializable;
4 |
5 | import org.springframework.samples.jpetstore.domain.Account;
6 |
7 | /**
8 | * @author Juergen Hoeller
9 | * @since 01.12.2003
10 | */
11 | public class AccountForm implements Serializable {
12 |
13 | private Account account;
14 |
15 | private boolean newAccount;
16 |
17 | private String repeatedPassword;
18 |
19 | public AccountForm(Account account) {
20 | this.account = account;
21 | this.newAccount = false;
22 | }
23 |
24 | public AccountForm() {
25 | this.account = new Account();
26 | this.newAccount = true;
27 | }
28 |
29 | public Account getAccount() {
30 | return account;
31 | }
32 |
33 | public boolean isNewAccount() {
34 | return newAccount;
35 | }
36 |
37 | public void setRepeatedPassword(String repeatedPassword) {
38 | this.repeatedPassword = repeatedPassword;
39 | }
40 |
41 | public String getRepeatedPassword() {
42 | return repeatedPassword;
43 | }
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/web/spring/AddItemToCartController.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.web.spring;
2 |
3 | import javax.servlet.http.HttpServletRequest;
4 | import javax.servlet.http.HttpServletResponse;
5 |
6 | import org.springframework.samples.jpetstore.domain.Cart;
7 | import org.springframework.samples.jpetstore.domain.Item;
8 | import org.springframework.samples.jpetstore.domain.logic.PetStoreFacade;
9 | import org.springframework.web.servlet.ModelAndView;
10 | import org.springframework.web.servlet.mvc.Controller;
11 | import org.springframework.web.util.WebUtils;
12 |
13 | /**
14 | * @author Juergen Hoeller
15 | * @since 30.11.2003
16 | */
17 | public class AddItemToCartController implements Controller {
18 |
19 | private PetStoreFacade petStore;
20 |
21 | public void setPetStore(PetStoreFacade petStore) {
22 | this.petStore = petStore;
23 | }
24 |
25 | public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {
26 | Cart cart = (Cart) WebUtils.getOrCreateSessionAttribute(request.getSession(), "sessionCart", Cart.class);
27 | String workingItemId = request.getParameter("workingItemId");
28 | if (cart.containsItemId(workingItemId)) {
29 | cart.incrementQuantityByItemId(workingItemId);
30 | }
31 | else {
32 | // isInStock is a "real-time" property that must be updated
33 | // every time an item is added to the cart, even if other
34 | // item details are cached.
35 | boolean isInStock = this.petStore.isItemInStock(workingItemId);
36 | Item item = this.petStore.getItem(workingItemId);
37 | cart.addItem(item, isInStock);
38 | }
39 | return new ModelAndView("Cart", "cart", cart);
40 | }
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/web/spring/ListOrdersController.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.web.spring;
2 |
3 | import java.util.HashMap;
4 | import java.util.Map;
5 |
6 | import javax.servlet.http.HttpServletRequest;
7 | import javax.servlet.http.HttpServletResponse;
8 |
9 | import org.springframework.samples.jpetstore.domain.logic.PetStoreFacade;
10 | import org.springframework.web.servlet.ModelAndView;
11 | import org.springframework.web.servlet.mvc.Controller;
12 | import org.springframework.web.util.WebUtils;
13 |
14 | /**
15 | * @author Juergen Hoeller
16 | * @since 01.12.2003
17 | */
18 | public class ListOrdersController implements Controller {
19 |
20 | private PetStoreFacade petStore;
21 |
22 | public void setPetStore(PetStoreFacade petStore) {
23 | this.petStore = petStore;
24 | }
25 |
26 | public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {
27 | UserSession userSession = (UserSession) WebUtils.getRequiredSessionAttribute(request, "userSession");
28 | String username = userSession.getAccount().getUsername();
29 | Map model = new HashMap();
30 | model.put("orderList", this.petStore.getOrdersByUsername(username));
31 | return new ModelAndView("ListOrders", model);
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/web/spring/OrderForm.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.web.spring;
2 |
3 | import java.io.Serializable;
4 |
5 | import org.springframework.samples.jpetstore.domain.Order;
6 |
7 | /**
8 | * @author Juergen Hoeller
9 | * @since 01.12.2003
10 | */
11 | public class OrderForm implements Serializable {
12 |
13 | private final Order order = new Order();
14 |
15 | private boolean shippingAddressRequired;
16 |
17 | private boolean confirmed;
18 |
19 | public Order getOrder() {
20 | return order;
21 | }
22 |
23 | public void setShippingAddressRequired(boolean shippingAddressRequired) {
24 | this.shippingAddressRequired = shippingAddressRequired;
25 | }
26 |
27 | public boolean isShippingAddressRequired() {
28 | return shippingAddressRequired;
29 | }
30 |
31 | public void setConfirmed(boolean confirmed) {
32 | this.confirmed = confirmed;
33 | }
34 |
35 | public boolean isConfirmed() {
36 | return confirmed;
37 | }
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/web/spring/RemoveItemFromCartController.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.web.spring;
2 |
3 | import javax.servlet.http.HttpServletRequest;
4 | import javax.servlet.http.HttpServletResponse;
5 |
6 | import org.springframework.samples.jpetstore.domain.Cart;
7 | import org.springframework.web.servlet.ModelAndView;
8 | import org.springframework.web.servlet.mvc.Controller;
9 | import org.springframework.web.util.WebUtils;
10 |
11 | /**
12 | * @author Juergen Hoeller
13 | * @since 30.11.2003
14 | */
15 | public class RemoveItemFromCartController implements Controller {
16 |
17 | public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {
18 | Cart cart = (Cart) WebUtils.getOrCreateSessionAttribute(request.getSession(), "sessionCart", Cart.class);
19 | cart.removeItemById(request.getParameter("workingItemId"));
20 | return new ModelAndView("Cart", "cart", cart);
21 | }
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/web/spring/SearchProductsController.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.web.spring;
2 |
3 | import javax.servlet.http.HttpServletRequest;
4 | import javax.servlet.http.HttpServletResponse;
5 |
6 | import org.springframework.beans.support.PagedListHolder;
7 | import org.springframework.samples.jpetstore.domain.logic.PetStoreFacade;
8 | import org.springframework.util.StringUtils;
9 | import org.springframework.web.servlet.ModelAndView;
10 | import org.springframework.web.servlet.mvc.Controller;
11 |
12 | /**
13 | * @author Juergen Hoeller
14 | * @since 30.11.2003
15 | */
16 | public class SearchProductsController implements Controller {
17 |
18 | private PetStoreFacade petStore;
19 |
20 | public void setPetStore(PetStoreFacade petStore) {
21 | this.petStore = petStore;
22 | }
23 |
24 | public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {
25 | String keyword = request.getParameter("keyword");
26 | if (keyword != null) {
27 | if (!StringUtils.hasLength(keyword)) {
28 | return new ModelAndView("Error", "message", "Please enter a keyword to search for, then press the search button.");
29 | }
30 | PagedListHolder productList = new PagedListHolder(this.petStore.searchProductList(keyword.toLowerCase()));
31 | productList.setPageSize(4);
32 | request.getSession().setAttribute("SearchProductsController_productList", productList);
33 | return new ModelAndView("SearchProducts", "productList", productList);
34 | }
35 | else {
36 | String page = request.getParameter("page");
37 | PagedListHolder productList = (PagedListHolder) request.getSession().getAttribute("SearchProductsController_productList");
38 | if (productList == null) {
39 | return new ModelAndView("Error", "message", "Your session has timed out. Please start over again.");
40 | }
41 | if ("next".equals(page)) {
42 | productList.nextPage();
43 | }
44 | else if ("previous".equals(page)) {
45 | productList.previousPage();
46 | }
47 | return new ModelAndView("SearchProducts", "productList", productList);
48 | }
49 | }
50 |
51 | }
52 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/web/spring/SignoffController.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.web.spring;
2 |
3 | import javax.servlet.http.HttpServletRequest;
4 | import javax.servlet.http.HttpServletResponse;
5 |
6 | import org.springframework.web.servlet.ModelAndView;
7 | import org.springframework.web.servlet.mvc.Controller;
8 |
9 | /**
10 | * @author Juergen Hoeller
11 | * @since 30.11.2003
12 | */
13 | public class SignoffController implements Controller {
14 |
15 | public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {
16 | request.getSession().removeAttribute("userSession");
17 | request.getSession().invalidate();
18 | return new ModelAndView("index");
19 | }
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/web/spring/SignonController.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.web.spring;
2 |
3 | import javax.servlet.http.HttpServletRequest;
4 | import javax.servlet.http.HttpServletResponse;
5 |
6 | import org.springframework.beans.support.PagedListHolder;
7 | import org.springframework.samples.jpetstore.domain.Account;
8 | import org.springframework.samples.jpetstore.domain.logic.PetStoreFacade;
9 | import org.springframework.web.servlet.ModelAndView;
10 | import org.springframework.web.servlet.mvc.Controller;
11 |
12 | /**
13 | * @author Juergen Hoeller
14 | * @since 30.11.2003
15 | */
16 | public class SignonController implements Controller {
17 |
18 | private PetStoreFacade petStore;
19 |
20 | public void setPetStore(PetStoreFacade petStore) {
21 | this.petStore = petStore;
22 | }
23 |
24 | public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {
25 | String username = request.getParameter("username");
26 | String password = request.getParameter("password");
27 | Account account = this.petStore.getAccount(username, password);
28 | if (account == null) {
29 | return new ModelAndView("Error", "message", "Invalid username or password. Signon failed.");
30 | }
31 | else {
32 | UserSession userSession = new UserSession(account);
33 | PagedListHolder myList = new PagedListHolder(this.petStore.getProductListByCategory(account.getFavouriteCategoryId()));
34 | myList.setPageSize(4);
35 | userSession.setMyList(myList);
36 | request.getSession().setAttribute("userSession", userSession);
37 | String forwardAction = request.getParameter("forwardAction");
38 | if (forwardAction != null) {
39 | response.sendRedirect(forwardAction);
40 | return null;
41 | }
42 | else {
43 | return new ModelAndView("index");
44 | }
45 | }
46 | }
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/web/spring/SignonInterceptor.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.web.spring;
2 |
3 | import javax.servlet.http.HttpServletRequest;
4 | import javax.servlet.http.HttpServletResponse;
5 |
6 | import org.springframework.web.servlet.ModelAndView;
7 | import org.springframework.web.servlet.ModelAndViewDefiningException;
8 | import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
9 | import org.springframework.web.util.WebUtils;
10 |
11 | /**
12 | * @author Juergen Hoeller
13 | * @since 01.12.2003
14 | */
15 | public class SignonInterceptor extends HandlerInterceptorAdapter {
16 |
17 | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
18 | throws Exception {
19 | UserSession userSession = (UserSession) WebUtils.getSessionAttribute(request, "userSession");
20 | if (userSession == null) {
21 | String url = request.getServletPath();
22 | String query = request.getQueryString();
23 | ModelAndView modelAndView = new ModelAndView("SignonForm");
24 | if (query != null) {
25 | modelAndView.addObject("signonForwardAction", url+"?"+query);
26 | }
27 | else {
28 | modelAndView.addObject("signonForwardAction", url);
29 | }
30 | throw new ModelAndViewDefiningException(modelAndView);
31 | }
32 | else {
33 | return true;
34 | }
35 | }
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/web/spring/UpdateCartQuantitiesController.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.web.spring;
2 |
3 | import java.util.Iterator;
4 |
5 | import javax.servlet.http.HttpServletRequest;
6 | import javax.servlet.http.HttpServletResponse;
7 |
8 | import org.springframework.samples.jpetstore.domain.Cart;
9 | import org.springframework.samples.jpetstore.domain.CartItem;
10 | import org.springframework.web.servlet.ModelAndView;
11 | import org.springframework.web.servlet.mvc.Controller;
12 | import org.springframework.web.util.WebUtils;
13 |
14 | /**
15 | * @author Juergen Hoeller
16 | * @since 30.11.2003
17 | */
18 | public class UpdateCartQuantitiesController implements Controller {
19 |
20 | public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {
21 | Cart cart = (Cart) WebUtils.getOrCreateSessionAttribute(request.getSession(), "sessionCart", Cart.class);
22 | Iterator cartItems = cart.getAllCartItems();
23 | while (cartItems.hasNext()) {
24 | CartItem cartItem = (CartItem) cartItems.next();
25 | String itemId = cartItem.getItem().getItemId();
26 | try {
27 | int quantity = Integer.parseInt(request.getParameter(itemId));
28 | cart.setQuantityByItemId(itemId, quantity);
29 | if (quantity < 1) {
30 | cartItems.remove();
31 | }
32 | }
33 | catch (NumberFormatException ex) {
34 | // ignore on purpose
35 | }
36 | }
37 | request.getSession().setAttribute("sessionCart", cart);
38 | return new ModelAndView("Cart", "cart", cart);
39 | }
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/web/spring/UserSession.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.web.spring;
2 |
3 | import java.io.Serializable;
4 |
5 | import org.springframework.beans.support.PagedListHolder;
6 | import org.springframework.samples.jpetstore.domain.Account;
7 |
8 | /**
9 | * @author Juergen Hoeller
10 | * @since 30.11.2003
11 | */
12 | public class UserSession implements Serializable {
13 |
14 | private Account account;
15 |
16 | private PagedListHolder myList;
17 |
18 | public UserSession(Account account) {
19 | this.account = account;
20 | }
21 |
22 | public Account getAccount() {
23 | return account;
24 | }
25 |
26 | public void setMyList(PagedListHolder myList) {
27 | this.myList = myList;
28 | }
29 |
30 | public PagedListHolder getMyList() {
31 | return myList;
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/web/spring/ViewCartController.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.web.spring;
2 |
3 | import javax.servlet.http.HttpServletRequest;
4 | import javax.servlet.http.HttpServletResponse;
5 |
6 | import org.springframework.samples.jpetstore.domain.Cart;
7 | import org.springframework.web.servlet.ModelAndView;
8 | import org.springframework.web.servlet.mvc.Controller;
9 | import org.springframework.web.util.WebUtils;
10 |
11 | /**
12 | * @author Juergen Hoeller
13 | * @since 30.11.2003
14 | */
15 | public class ViewCartController implements Controller {
16 |
17 | private String successView;
18 |
19 | public void setSuccessView(String successView) {
20 | this.successView = successView;
21 | }
22 |
23 | public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {
24 | UserSession userSession = (UserSession) WebUtils.getSessionAttribute(request, "userSession");
25 | Cart cart = (Cart) WebUtils.getOrCreateSessionAttribute(request.getSession(), "sessionCart", Cart.class);
26 | String page = request.getParameter("page");
27 | if (userSession != null) {
28 | if ("next".equals(page)) {
29 | userSession.getMyList().nextPage();
30 | }
31 | else if ("previous".equals(page)) {
32 | userSession.getMyList().previousPage();
33 | }
34 | }
35 | if ("nextCart".equals(page)) {
36 | cart.getCartItemList().nextPage();
37 | }
38 | else if ("previousCart".equals(page)) {
39 | cart.getCartItemList().previousPage();
40 | }
41 | return new ModelAndView(this.successView, "cart", cart);
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/web/spring/ViewCategoryController.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.web.spring;
2 |
3 | import java.util.HashMap;
4 | import java.util.Map;
5 |
6 | import javax.servlet.http.HttpServletRequest;
7 | import javax.servlet.http.HttpServletResponse;
8 |
9 | import org.springframework.beans.support.PagedListHolder;
10 | import org.springframework.samples.jpetstore.domain.Category;
11 | import org.springframework.samples.jpetstore.domain.logic.PetStoreFacade;
12 | import org.springframework.web.servlet.ModelAndView;
13 | import org.springframework.web.servlet.mvc.Controller;
14 |
15 | /**
16 | * @author Juergen Hoeller
17 | * @since 30.11.2003
18 | */
19 | public class ViewCategoryController implements Controller {
20 |
21 | private PetStoreFacade petStore;
22 |
23 | public void setPetStore(PetStoreFacade petStore) {
24 | this.petStore = petStore;
25 | }
26 |
27 | public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {
28 | Map model = new HashMap();
29 | String categoryId = request.getParameter("categoryId");
30 | if (categoryId != null) {
31 | Category category = this.petStore.getCategory(categoryId);
32 | PagedListHolder productList = new PagedListHolder(this.petStore.getProductListByCategory(categoryId));
33 | productList.setPageSize(4);
34 | request.getSession().setAttribute("ViewProductAction_category", category);
35 | request.getSession().setAttribute("ViewProductAction_productList", productList);
36 | model.put("category", category);
37 | model.put("productList", productList);
38 | }
39 | else {
40 | Category category = (Category) request.getSession().getAttribute("ViewProductAction_category");
41 | PagedListHolder productList = (PagedListHolder) request.getSession().getAttribute("ViewProductAction_productList");
42 | if (category == null || productList == null) {
43 | throw new IllegalStateException("Cannot find pre-loaded category and product list");
44 | }
45 | String page = request.getParameter("page");
46 | if ("next".equals(page)) {
47 | productList.nextPage();
48 | }
49 | else if ("previous".equals(page)) {
50 | productList.previousPage();
51 | }
52 | model.put("category", category);
53 | model.put("productList", productList);
54 | }
55 | return new ModelAndView("Category", model);
56 | }
57 |
58 | }
59 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/web/spring/ViewItemController.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.web.spring;
2 |
3 | import java.util.HashMap;
4 | import java.util.Map;
5 |
6 | import javax.servlet.http.HttpServletRequest;
7 | import javax.servlet.http.HttpServletResponse;
8 |
9 | import org.springframework.samples.jpetstore.domain.Item;
10 | import org.springframework.samples.jpetstore.domain.logic.PetStoreFacade;
11 | import org.springframework.web.servlet.ModelAndView;
12 | import org.springframework.web.servlet.mvc.Controller;
13 |
14 | /**
15 | * @author Juergen Hoeller
16 | * @since 30.11.2003
17 | */
18 | public class ViewItemController implements Controller {
19 |
20 | private PetStoreFacade petStore;
21 |
22 | public void setPetStore(PetStoreFacade petStore) {
23 | this.petStore = petStore;
24 | }
25 |
26 | public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {
27 | String itemId = request.getParameter("itemId");
28 | Item item = this.petStore.getItem(itemId);
29 | Map model = new HashMap();
30 | model.put("item", item);
31 | model.put("product", item.getProduct());
32 | return new ModelAndView("Item", model);
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/web/spring/ViewOrderController.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.web.spring;
2 |
3 | import javax.servlet.http.HttpServletRequest;
4 | import javax.servlet.http.HttpServletResponse;
5 |
6 | import org.springframework.samples.jpetstore.domain.Order;
7 | import org.springframework.samples.jpetstore.domain.logic.PetStoreFacade;
8 | import org.springframework.web.servlet.ModelAndView;
9 | import org.springframework.web.servlet.mvc.Controller;
10 | import org.springframework.web.util.WebUtils;
11 |
12 | /**
13 | * @author Juergen Hoeller
14 | * @since 01.12.2003
15 | */
16 | public class ViewOrderController implements Controller {
17 |
18 | private PetStoreFacade petStore;
19 |
20 | public void setPetStore(PetStoreFacade petStore) {
21 | this.petStore = petStore;
22 | }
23 |
24 | public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {
25 | UserSession userSession = (UserSession) WebUtils.getRequiredSessionAttribute(request, "userSession");
26 | int orderId = Integer.parseInt(request.getParameter("orderId"));
27 | Order order = this.petStore.getOrder(orderId);
28 | if (userSession.getAccount().getUsername().equals(order.getUsername())) {
29 | return new ModelAndView("ViewOrder", "order", order);
30 | }
31 | else {
32 | return new ModelAndView("Error", "message", "You may only view your own orders.");
33 | }
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/web/spring/ViewProductController.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.web.spring;
2 |
3 | import java.util.HashMap;
4 | import java.util.Map;
5 |
6 | import javax.servlet.http.HttpServletRequest;
7 | import javax.servlet.http.HttpServletResponse;
8 |
9 | import org.springframework.beans.support.PagedListHolder;
10 | import org.springframework.samples.jpetstore.domain.Product;
11 | import org.springframework.samples.jpetstore.domain.logic.PetStoreFacade;
12 | import org.springframework.web.servlet.ModelAndView;
13 | import org.springframework.web.servlet.mvc.Controller;
14 |
15 | /**
16 | * @author Juergen Hoeller
17 | * @since 30.11.2003
18 | */
19 | public class ViewProductController implements Controller {
20 |
21 | private PetStoreFacade petStore;
22 |
23 | public void setPetStore(PetStoreFacade petStore) {
24 | this.petStore = petStore;
25 | }
26 |
27 | public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {
28 | Map model = new HashMap();
29 | String productId = request.getParameter("productId");
30 | if (productId != null) {
31 | PagedListHolder itemList = new PagedListHolder(this.petStore.getItemListByProduct(productId));
32 | itemList.setPageSize(4);
33 | Product product = this.petStore.getProduct(productId);
34 | request.getSession().setAttribute("ViewProductAction_itemList", itemList);
35 | request.getSession().setAttribute("ViewProductAction_product", product);
36 | model.put("itemList", itemList);
37 | model.put("product", product);
38 | }
39 | else {
40 | PagedListHolder itemList = (PagedListHolder) request.getSession().getAttribute("ViewProductAction_itemList");
41 | Product product = (Product) request.getSession().getAttribute("ViewProductAction_product");
42 | String page = request.getParameter("page");
43 | if ("next".equals(page)) {
44 | itemList.nextPage();
45 | }
46 | else if ("previous".equals(page)) {
47 | itemList.previousPage();
48 | }
49 | model.put("itemList", itemList);
50 | model.put("product", product);
51 | }
52 | return new ModelAndView("Product", model);
53 | }
54 |
55 | }
56 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/web/struts/AddItemToCartAction.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.web.struts;
2 |
3 | import javax.servlet.http.HttpServletRequest;
4 | import javax.servlet.http.HttpServletResponse;
5 |
6 | import org.apache.struts.action.ActionForm;
7 | import org.apache.struts.action.ActionForward;
8 | import org.apache.struts.action.ActionMapping;
9 |
10 | import org.springframework.samples.jpetstore.domain.Cart;
11 | import org.springframework.samples.jpetstore.domain.Item;
12 |
13 | public class AddItemToCartAction extends BaseAction {
14 |
15 | public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
16 | CartActionForm cartForm = (CartActionForm) form;
17 | Cart cart = cartForm.getCart();
18 | String workingItemId = cartForm.getWorkingItemId();
19 | if (cart.containsItemId(workingItemId)) {
20 | cart.incrementQuantityByItemId(workingItemId);
21 | }
22 | else {
23 | // isInStock is a "real-time" property that must be updated
24 | // every time an item is added to the cart, even if other
25 | // item details are cached.
26 | boolean isInStock = getPetStore().isItemInStock(workingItemId);
27 | Item item = getPetStore().getItem(workingItemId);
28 | cartForm.getCart().addItem(item, isInStock);
29 | }
30 | return mapping.findForward("success");
31 | }
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/web/struts/BaseAction.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.web.struts;
2 |
3 | import javax.servlet.ServletContext;
4 |
5 | import org.apache.struts.action.Action;
6 | import org.apache.struts.action.ActionServlet;
7 |
8 | import org.springframework.samples.jpetstore.domain.logic.PetStoreFacade;
9 | import org.springframework.web.context.WebApplicationContext;
10 | import org.springframework.web.context.support.WebApplicationContextUtils;
11 |
12 | /**
13 | * Superclass for Struts actions in JPetStore's web tier.
14 | *
15 | *
Looks up the Spring WebApplicationContext via the ServletContext
16 | * and obtains the PetStoreFacade implementation from it, making it
17 | * available to subclasses via a protected getter method.
18 | *
19 | *
As alternative to such a base class, consider using Spring's
20 | * ActionSupport class for Struts, which pre-implements
21 | * WebApplicationContext lookup in a generic fashion.
22 | *
23 | * @author Juergen Hoeller
24 | * @since 30.11.2003
25 | * @see #getPetStore
26 | * @see org.springframework.web.context.support.WebApplicationContextUtils#getRequiredWebApplicationContext
27 | * @see org.springframework.web.struts.ActionSupport
28 | */
29 | public abstract class BaseAction extends Action {
30 |
31 | private PetStoreFacade petStore;
32 |
33 | public void setServlet(ActionServlet actionServlet) {
34 | super.setServlet(actionServlet);
35 | if (actionServlet != null) {
36 | ServletContext servletContext = actionServlet.getServletContext();
37 | WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext);
38 | this.petStore = (PetStoreFacade) wac.getBean("petStore");
39 | }
40 | }
41 |
42 | protected PetStoreFacade getPetStore() {
43 | return petStore;
44 | }
45 |
46 | }
47 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/web/struts/BaseActionForm.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.web.struts;
2 |
3 | import java.util.ArrayList;
4 | import java.util.List;
5 |
6 | import javax.servlet.http.HttpServletRequest;
7 |
8 | import org.apache.struts.action.ActionError;
9 | import org.apache.struts.action.ActionErrors;
10 | import org.apache.struts.action.ActionForm;
11 | import org.apache.struts.action.ActionMapping;
12 |
13 | public class BaseActionForm extends ActionForm {
14 |
15 | /* Public Methods */
16 |
17 | public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
18 | ActionErrors actionErrors = null;
19 | ArrayList errorList = new ArrayList();
20 | doValidate(mapping, request, errorList);
21 | request.setAttribute("errors", errorList);
22 | if (!errorList.isEmpty()) {
23 | actionErrors = new ActionErrors();
24 | actionErrors.add(ActionErrors.GLOBAL_ERROR, new ActionError("global.error"));
25 | }
26 | return actionErrors;
27 | }
28 |
29 | public void doValidate(ActionMapping mapping, HttpServletRequest request, List errors) {
30 | }
31 |
32 | /* Protected Methods */
33 |
34 | protected void addErrorIfStringEmpty(List errors, String message, String value) {
35 | if (value == null || value.trim().length() < 1) {
36 | errors.add(message);
37 | }
38 | }
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/web/struts/CartActionForm.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.web.struts;
2 |
3 | import javax.servlet.http.HttpServletRequest;
4 |
5 | import org.apache.struts.action.ActionMapping;
6 |
7 | import org.springframework.samples.jpetstore.domain.Cart;
8 |
9 | public class CartActionForm extends BaseActionForm {
10 |
11 | /* Private Fields */
12 |
13 | private Cart cart = new Cart();
14 | private String workingItemId;
15 |
16 | /* JavaBeans Properties */
17 |
18 | public Cart getCart() { return cart; }
19 | public void setCart(Cart cart) { this.cart = cart; }
20 |
21 | public String getWorkingItemId() { return workingItemId; }
22 | public void setWorkingItemId(String workingItemId) { this.workingItemId = workingItemId; }
23 |
24 | /* Public Methods */
25 |
26 | public void reset(ActionMapping mapping, HttpServletRequest request) {
27 | super.reset(mapping, request);
28 | workingItemId = null;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/web/struts/DoNothingAction.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.web.struts;
2 |
3 | import javax.servlet.http.HttpServletRequest;
4 | import javax.servlet.http.HttpServletResponse;
5 |
6 | import org.apache.struts.action.ActionForm;
7 | import org.apache.struts.action.ActionForward;
8 | import org.apache.struts.action.ActionMapping;
9 |
10 | public class DoNothingAction extends BaseAction {
11 |
12 | /* Public Methods */
13 |
14 | public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
15 | return mapping.findForward("success");
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/web/struts/EditAccountAction.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.web.struts;
2 |
3 | import javax.servlet.http.HttpServletRequest;
4 | import javax.servlet.http.HttpServletResponse;
5 |
6 | import org.apache.struts.action.ActionForm;
7 | import org.apache.struts.action.ActionForward;
8 | import org.apache.struts.action.ActionMapping;
9 |
10 | import org.springframework.beans.support.PagedListHolder;
11 | import org.springframework.samples.jpetstore.domain.Account;
12 |
13 | public class EditAccountAction extends SecureBaseAction {
14 |
15 | protected ActionForward doExecute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
16 | AccountActionForm acctForm = (AccountActionForm) form;
17 | if (AccountActionForm.VALIDATE_EDIT_ACCOUNT.equals(acctForm.getValidate())) {
18 | acctForm.getAccount().setListOption(request.getParameter("account.listOption") != null);
19 | acctForm.getAccount().setBannerOption(request.getParameter("account.bannerOption") != null);
20 | Account account = acctForm.getAccount();
21 | getPetStore().updateAccount(account);
22 | acctForm.setAccount(getPetStore().getAccount(account.getUsername()));
23 | PagedListHolder myList = new PagedListHolder(getPetStore().getProductListByCategory(account.getFavouriteCategoryId()));
24 | myList.setPageSize(4);
25 | acctForm.setMyList(myList);
26 | request.getSession().setAttribute("accountForm", acctForm);
27 | request.getSession().removeAttribute("workingAccountForm");
28 | return mapping.findForward("success");
29 | }
30 | else {
31 | request.setAttribute("message", "Your account was not updated because the submitted information was not validated.");
32 | return mapping.findForward("failure");
33 | }
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/web/struts/EditAccountFormAction.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.web.struts;
2 |
3 | import java.util.List;
4 |
5 | import javax.servlet.http.HttpServletRequest;
6 | import javax.servlet.http.HttpServletResponse;
7 |
8 | import org.apache.struts.action.ActionForm;
9 | import org.apache.struts.action.ActionForward;
10 | import org.apache.struts.action.ActionMapping;
11 |
12 | import org.springframework.samples.jpetstore.domain.Account;
13 |
14 | public class EditAccountFormAction extends SecureBaseAction {
15 |
16 | protected ActionForward doExecute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
17 | AccountActionForm workingAcctForm = (AccountActionForm) form;
18 | AccountActionForm acctForm = (AccountActionForm) request.getSession().getAttribute("accountForm");
19 | String username = acctForm.getAccount().getUsername();
20 | if (workingAcctForm.getAccount() == null) {
21 | Account account = getPetStore().getAccount(username);
22 | workingAcctForm.setAccount(account);
23 | }
24 | if (workingAcctForm.getCategories() == null) {
25 | List categories = getPetStore().getCategoryList();
26 | workingAcctForm.setCategories(categories);
27 | }
28 | return mapping.findForward("success");
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/web/struts/ListOrdersAction.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.web.struts;
2 |
3 | import javax.servlet.http.HttpServletRequest;
4 | import javax.servlet.http.HttpServletResponse;
5 |
6 | import org.apache.struts.action.ActionForm;
7 | import org.apache.struts.action.ActionForward;
8 | import org.apache.struts.action.ActionMapping;
9 |
10 | public class ListOrdersAction extends SecureBaseAction {
11 |
12 | protected ActionForward doExecute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
13 | AccountActionForm acctForm = (AccountActionForm) form;
14 | String username = acctForm.getAccount().getUsername();
15 | request.setAttribute("orderList", getPetStore().getOrdersByUsername(username));
16 | return mapping.findForward("success");
17 | }
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/web/struts/NewAccountAction.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.web.struts;
2 |
3 | import javax.servlet.http.HttpServletRequest;
4 | import javax.servlet.http.HttpServletResponse;
5 |
6 | import org.apache.struts.action.ActionForm;
7 | import org.apache.struts.action.ActionForward;
8 | import org.apache.struts.action.ActionMapping;
9 |
10 | import org.springframework.beans.support.PagedListHolder;
11 | import org.springframework.samples.jpetstore.domain.Account;
12 |
13 | public class NewAccountAction extends BaseAction {
14 |
15 | public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
16 | AccountActionForm acctForm = (AccountActionForm) form;
17 | if (AccountActionForm.VALIDATE_NEW_ACCOUNT.equals(acctForm.getValidate())) {
18 | acctForm.getAccount().setListOption(request.getParameter("account.listOption") != null);
19 | acctForm.getAccount().setBannerOption(request.getParameter("account.bannerOption") != null);
20 | Account account = acctForm.getAccount();
21 | String username = acctForm.getAccount().getUsername();
22 | getPetStore().insertAccount(account);
23 | acctForm.setAccount(getPetStore().getAccount(username));
24 | PagedListHolder myList = new PagedListHolder(getPetStore().getProductListByCategory(account.getFavouriteCategoryId()));
25 | myList.setPageSize(4);
26 | acctForm.setMyList(myList);
27 | request.getSession().setAttribute("accountForm", acctForm);
28 | request.getSession().removeAttribute("workingAccountForm");
29 | return mapping.findForward("success");
30 | }
31 | else {
32 | request.setAttribute("message", "Your account was not created because the submitted information was not validated.");
33 | return mapping.findForward("failure");
34 | }
35 | }
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/web/struts/NewAccountFormAction.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.web.struts;
2 |
3 | import javax.servlet.http.HttpServletRequest;
4 | import javax.servlet.http.HttpServletResponse;
5 |
6 | import org.apache.struts.action.ActionForm;
7 | import org.apache.struts.action.ActionForward;
8 | import org.apache.struts.action.ActionMapping;
9 |
10 | import org.springframework.samples.jpetstore.domain.Account;
11 |
12 | public class NewAccountFormAction extends BaseAction {
13 |
14 | public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
15 | AccountActionForm workingAcctForm = new AccountActionForm();
16 | request.getSession().removeAttribute("workingAccountForm");
17 | request.getSession().setAttribute("workingAccountForm", workingAcctForm);
18 | if (workingAcctForm.getAccount() == null) {
19 | workingAcctForm.setAccount(new Account());
20 | }
21 | if (workingAcctForm.getCategories() == null) {
22 | workingAcctForm.setCategories(getPetStore().getCategoryList());
23 | }
24 | return mapping.findForward("success");
25 | }
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/web/struts/NewOrderAction.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.web.struts;
2 |
3 | import javax.servlet.http.HttpServletRequest;
4 | import javax.servlet.http.HttpServletResponse;
5 |
6 | import org.apache.struts.action.ActionForm;
7 | import org.apache.struts.action.ActionForward;
8 | import org.apache.struts.action.ActionMapping;
9 |
10 | import org.springframework.samples.jpetstore.domain.Order;
11 |
12 | public class NewOrderAction extends SecureBaseAction {
13 |
14 | protected ActionForward doExecute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
15 | OrderActionForm orderForm = (OrderActionForm) form;
16 | if (orderForm.isShippingAddressRequired()) {
17 | return mapping.findForward("shipping");
18 | }
19 | else if (!orderForm.isConfirmed()) {
20 | return mapping.findForward("confirm");
21 | }
22 | else if (orderForm.getOrder() != null) {
23 | Order order = orderForm.getOrder();
24 | getPetStore().insertOrder(order);
25 | request.getSession().removeAttribute("workingOrderForm");
26 | request.getSession().removeAttribute("cartForm");
27 | request.setAttribute("order", order);
28 | request.setAttribute("message", "Thank you, your order has been submitted.");
29 | return mapping.findForward("success");
30 | }
31 | else {
32 | request.setAttribute("message", "An error occurred processing your order (order was null).");
33 | return mapping.findForward("failure");
34 | }
35 | }
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/web/struts/NewOrderFormAction.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.web.struts;
2 |
3 | import javax.servlet.http.HttpServletRequest;
4 | import javax.servlet.http.HttpServletResponse;
5 |
6 | import org.apache.struts.action.ActionForm;
7 | import org.apache.struts.action.ActionForward;
8 | import org.apache.struts.action.ActionMapping;
9 |
10 | import org.springframework.samples.jpetstore.domain.Account;
11 |
12 | public class NewOrderFormAction extends SecureBaseAction {
13 |
14 | protected ActionForward doExecute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
15 | AccountActionForm acctForm = (AccountActionForm) request.getSession().getAttribute("accountForm");
16 | CartActionForm cartForm = (CartActionForm) request.getSession().getAttribute("cartForm");
17 | if (cartForm != null) {
18 | OrderActionForm orderForm = (OrderActionForm) form;
19 | // Re-read account from DB at team's request.
20 | Account account = getPetStore().getAccount(acctForm.getAccount().getUsername());
21 | orderForm.getOrder().initOrder(account, cartForm.getCart());
22 | return mapping.findForward("success");
23 | }
24 | else {
25 | request.setAttribute("message", "An order could not be created because a cart could not be found.");
26 | return mapping.findForward("failure");
27 | }
28 | }
29 |
30 | }
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/web/struts/RemoveItemFromCartAction.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.web.struts;
2 |
3 | import javax.servlet.http.HttpServletRequest;
4 | import javax.servlet.http.HttpServletResponse;
5 |
6 | import org.apache.struts.action.ActionForm;
7 | import org.apache.struts.action.ActionForward;
8 | import org.apache.struts.action.ActionMapping;
9 |
10 | public class RemoveItemFromCartAction extends BaseAction {
11 |
12 | public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
13 | CartActionForm cartForm = (CartActionForm) form;
14 | cartForm.getCart().removeItemById(cartForm.getWorkingItemId());
15 | return mapping.findForward("success");
16 | }
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/web/struts/SearchProductsAction.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.web.struts;
2 |
3 | import javax.servlet.http.HttpServletRequest;
4 | import javax.servlet.http.HttpServletResponse;
5 |
6 | import org.apache.struts.action.ActionForm;
7 | import org.apache.struts.action.ActionForward;
8 | import org.apache.struts.action.ActionMapping;
9 |
10 | import org.springframework.beans.support.PagedListHolder;
11 | import org.springframework.util.StringUtils;
12 |
13 | public class SearchProductsAction extends BaseAction {
14 |
15 | public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
16 | String keyword = request.getParameter("keyword");
17 | if (keyword != null) {
18 | if (!StringUtils.hasLength(keyword)) {
19 | request.setAttribute("message", "Please enter a keyword to search for, then press the search button.");
20 | return mapping.findForward("failure");
21 | }
22 | PagedListHolder productList = new PagedListHolder(getPetStore().searchProductList(keyword.toLowerCase()));
23 | productList.setPageSize(4);
24 | request.getSession().setAttribute("SearchProductsAction_productList", productList);
25 | request.setAttribute("productList", productList);
26 | return mapping.findForward("success");
27 | }
28 | else {
29 | String page = request.getParameter("page");
30 | PagedListHolder productList = (PagedListHolder) request.getSession().getAttribute("SearchProductsAction_productList");
31 | if (productList == null) {
32 | request.setAttribute("message", "Your session has timed out. Please start over again.");
33 | return mapping.findForward("failure");
34 | }
35 | if ("next".equals(page)) {
36 | productList.nextPage();
37 | }
38 | else if ("previous".equals(page)) {
39 | productList.previousPage();
40 | }
41 | request.setAttribute("productList", productList);
42 | return mapping.findForward("success");
43 | }
44 | }
45 |
46 | }
47 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/web/struts/SecureBaseAction.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.web.struts;
2 |
3 | import javax.servlet.http.HttpServletRequest;
4 | import javax.servlet.http.HttpServletResponse;
5 |
6 | import org.apache.struts.action.ActionForm;
7 | import org.apache.struts.action.ActionForward;
8 | import org.apache.struts.action.ActionMapping;
9 |
10 | public abstract class SecureBaseAction extends BaseAction {
11 |
12 | public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
13 | AccountActionForm acctForm = (AccountActionForm) request.getSession().getAttribute("accountForm");
14 | if (acctForm == null || acctForm.getAccount() == null) {
15 | String url = request.getServletPath();
16 | String query = request.getQueryString();
17 | if (query != null) {
18 | request.setAttribute("signonForwardAction", url+"?"+query);
19 | }
20 | else {
21 | request.setAttribute("signonForwardAction", url);
22 | }
23 | return mapping.findForward("global-signon");
24 | }
25 | else {
26 | return doExecute(mapping, form, request, response);
27 | }
28 | }
29 |
30 | protected abstract ActionForward doExecute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception;
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/web/struts/SignonAction.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.web.struts;
2 |
3 | import javax.servlet.http.HttpServletRequest;
4 | import javax.servlet.http.HttpServletResponse;
5 |
6 | import org.apache.struts.action.ActionForm;
7 | import org.apache.struts.action.ActionForward;
8 | import org.apache.struts.action.ActionMapping;
9 |
10 | import org.springframework.beans.support.PagedListHolder;
11 | import org.springframework.samples.jpetstore.domain.Account;
12 |
13 | public class SignonAction extends BaseAction {
14 |
15 | public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
16 | request.getSession().removeAttribute("workingAccountForm");
17 | request.getSession().removeAttribute("accountForm");
18 | if (request.getParameter("signoff") != null) {
19 | request.getSession().invalidate();
20 | return mapping.findForward("success");
21 | }
22 | else {
23 | AccountActionForm acctForm = (AccountActionForm) form;
24 | String username = acctForm.getUsername();
25 | String password = acctForm.getPassword();
26 | Account account = getPetStore().getAccount(username, password);
27 | if (account == null) {
28 | request.setAttribute("message", "Invalid username or password. Signon failed.");
29 | return mapping.findForward("failure");
30 | }
31 | else {
32 | String forwardAction = acctForm.getForwardAction();
33 | acctForm = new AccountActionForm();
34 | acctForm.setForwardAction(forwardAction);
35 | acctForm.setAccount(account);
36 | acctForm.getAccount().setPassword(null);
37 | PagedListHolder myList = new PagedListHolder(getPetStore().getProductListByCategory(account.getFavouriteCategoryId()));
38 | myList.setPageSize(4);
39 | acctForm.setMyList(myList);
40 | request.getSession().setAttribute("accountForm", acctForm);
41 | if (acctForm.getForwardAction() == null || acctForm.getForwardAction().length() < 1) {
42 | return mapping.findForward("success");
43 | }
44 | else {
45 | response.sendRedirect(acctForm.getForwardAction());
46 | return null;
47 | }
48 | }
49 | }
50 | }
51 |
52 | }
53 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/web/struts/UpdateCartQuantitiesAction.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.web.struts;
2 |
3 | import java.util.Iterator;
4 |
5 | import javax.servlet.http.HttpServletRequest;
6 | import javax.servlet.http.HttpServletResponse;
7 |
8 | import org.apache.struts.action.ActionForm;
9 | import org.apache.struts.action.ActionForward;
10 | import org.apache.struts.action.ActionMapping;
11 |
12 | import org.springframework.samples.jpetstore.domain.CartItem;
13 |
14 | public class UpdateCartQuantitiesAction extends BaseAction {
15 |
16 | public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
17 | CartActionForm cartForm = (CartActionForm) form;
18 | Iterator cartItems = cartForm.getCart().getAllCartItems();
19 | while (cartItems.hasNext()) {
20 | CartItem cartItem = (CartItem) cartItems.next();
21 | String itemId = cartItem.getItem().getItemId();
22 | try {
23 | int quantity = Integer.parseInt(request.getParameter(itemId));
24 | cartForm.getCart().setQuantityByItemId(itemId, quantity);
25 | if (quantity < 1) {
26 | cartItems.remove();
27 | }
28 | }
29 | catch (NumberFormatException e) {
30 | //ignore on purpose
31 | }
32 | }
33 | return mapping.findForward("success");
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/web/struts/ViewCartAction.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.web.struts;
2 |
3 | import javax.servlet.http.HttpServletRequest;
4 | import javax.servlet.http.HttpServletResponse;
5 |
6 | import org.apache.struts.action.ActionForm;
7 | import org.apache.struts.action.ActionForward;
8 | import org.apache.struts.action.ActionMapping;
9 |
10 | public class ViewCartAction extends BaseAction {
11 |
12 | public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
13 | CartActionForm cartForm = (CartActionForm) form;
14 | AccountActionForm acctForm = (AccountActionForm) request.getSession().getAttribute("accountForm");
15 | String page = request.getParameter("page");
16 | if (acctForm != null && acctForm.getAccount() != null) {
17 | if ("next".equals(page)) {
18 | acctForm.getMyList().nextPage();
19 | }
20 | else if ("previous".equals(page)) {
21 | acctForm.getMyList().previousPage();
22 | }
23 | }
24 | if ("nextCart".equals(page)) {
25 | cartForm.getCart().getCartItemList().nextPage();
26 | }
27 | else if ("previousCart".equals(page)) {
28 | cartForm.getCart().getCartItemList().previousPage();
29 | }
30 | return mapping.findForward("success");
31 | }
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/web/struts/ViewCategoryAction.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.web.struts;
2 |
3 | import javax.servlet.http.HttpServletRequest;
4 | import javax.servlet.http.HttpServletResponse;
5 |
6 | import org.apache.struts.action.ActionForm;
7 | import org.apache.struts.action.ActionForward;
8 | import org.apache.struts.action.ActionMapping;
9 |
10 | import org.springframework.beans.support.PagedListHolder;
11 | import org.springframework.samples.jpetstore.domain.Category;
12 |
13 | public class ViewCategoryAction extends BaseAction {
14 |
15 | public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
16 | String categoryId = request.getParameter("categoryId");
17 | if (categoryId != null) {
18 | Category category = getPetStore().getCategory(categoryId);
19 | PagedListHolder productList = new PagedListHolder(getPetStore().getProductListByCategory(categoryId));
20 | productList.setPageSize(4);
21 | request.getSession().setAttribute("ViewProductAction_category", category);
22 | request.getSession().setAttribute("ViewProductAction_productList", productList);
23 | request.setAttribute("category", category);
24 | request.setAttribute("productList", productList);
25 | }
26 | else {
27 | Category category = (Category) request.getSession().getAttribute("ViewProductAction_category");
28 | PagedListHolder productList = (PagedListHolder) request.getSession().getAttribute("ViewProductAction_productList");
29 | if (category == null || productList == null) {
30 | throw new IllegalStateException("Cannot find pre-loaded category and product list");
31 | }
32 | String page = request.getParameter("page");
33 | if ("next".equals(page)) {
34 | productList.nextPage();
35 | }
36 | else if ("previous".equals(page)) {
37 | productList.previousPage();
38 | }
39 | request.setAttribute("category", category);
40 | request.setAttribute("productList", productList);
41 | }
42 | return mapping.findForward("success");
43 | }
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/web/struts/ViewItemAction.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.web.struts;
2 |
3 | import javax.servlet.http.HttpServletRequest;
4 | import javax.servlet.http.HttpServletResponse;
5 |
6 | import org.apache.struts.action.ActionForm;
7 | import org.apache.struts.action.ActionForward;
8 | import org.apache.struts.action.ActionMapping;
9 |
10 | import org.springframework.samples.jpetstore.domain.Item;
11 |
12 | public class ViewItemAction extends BaseAction {
13 |
14 | public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
15 | String itemId = request.getParameter("itemId");
16 | Item item = getPetStore().getItem(itemId);
17 | request.setAttribute("item", item);
18 | request.setAttribute("product", item.getProduct());
19 | return mapping.findForward("success");
20 | }
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/web/struts/ViewOrderAction.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.web.struts;
2 |
3 | import javax.servlet.http.HttpServletRequest;
4 | import javax.servlet.http.HttpServletResponse;
5 |
6 | import org.apache.struts.action.ActionForm;
7 | import org.apache.struts.action.ActionForward;
8 | import org.apache.struts.action.ActionMapping;
9 |
10 | import org.springframework.samples.jpetstore.domain.Order;
11 |
12 | public class ViewOrderAction extends SecureBaseAction {
13 |
14 | protected ActionForward doExecute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
15 | AccountActionForm acctForm = (AccountActionForm) form;
16 | int orderId = Integer.parseInt(request.getParameter("orderId"));
17 | Order order = getPetStore().getOrder(orderId);
18 | if (acctForm.getAccount().getUsername().equals(order.getUsername())) {
19 | request.setAttribute("order", order);
20 | return mapping.findForward("success");
21 | }
22 | else {
23 | request.setAttribute("message", "You may only view your own orders.");
24 | return mapping.findForward("failure");
25 | }
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/jpetstore/src/main/java/org/springframework/samples/jpetstore/web/struts/ViewProductAction.java:
--------------------------------------------------------------------------------
1 | package org.springframework.samples.jpetstore.web.struts;
2 |
3 | import javax.servlet.http.HttpServletRequest;
4 | import javax.servlet.http.HttpServletResponse;
5 |
6 | import org.apache.struts.action.ActionForm;
7 | import org.apache.struts.action.ActionForward;
8 | import org.apache.struts.action.ActionMapping;
9 |
10 | import org.springframework.beans.support.PagedListHolder;
11 | import org.springframework.samples.jpetstore.domain.Product;
12 |
13 | public class ViewProductAction extends BaseAction {
14 |
15 | public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
16 | String productId = request.getParameter("productId");
17 | if (productId != null) {
18 | PagedListHolder itemList = new PagedListHolder(getPetStore().getItemListByProduct(productId));
19 | itemList.setPageSize(4);
20 | Product product = getPetStore().getProduct(productId);
21 | request.getSession().setAttribute("ViewProductAction_itemList", itemList);
22 | request.getSession().setAttribute("ViewProductAction_product", product);
23 | request.setAttribute("itemList", itemList);
24 | request.setAttribute("product", product);
25 | }
26 | else {
27 | PagedListHolder itemList = (PagedListHolder) request.getSession().getAttribute("ViewProductAction_itemList");
28 | Product product = (Product) request.getSession().getAttribute("ViewProductAction_product");
29 | String page = request.getParameter("page");
30 | if ("next".equals(page)) {
31 | itemList.nextPage();
32 | }
33 | else if ("previous".equals(page)) {
34 | itemList.previousPage();
35 | }
36 | request.setAttribute("itemList", itemList);
37 | request.setAttribute("product", product);
38 | }
39 | return mapping.findForward("success");
40 | }
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/META-INF/MANIFEST.MF:
--------------------------------------------------------------------------------
1 | Manifest-Version: 1.0
2 | Class-Path:
3 |
4 |
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/WEB-INF/dataAccessContext-local.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/WEB-INF/jdbc.properties:
--------------------------------------------------------------------------------
1 | # Properties file with JDBC-related settings.
2 | # Applied by PropertyPlaceholderConfigurer from "dataAccessContext-local.xml".
3 | # Targeted at system administrators, to avoid touching the context XML files.
4 |
5 | jdbc.driverClassName=org.hsqldb.jdbcDriver
6 | jdbc.url=jdbc:hsqldb:hsql://localhost:9002
7 | jdbc.username=sa
8 | jdbc.password=
9 |
10 | jdbc.sqlfire.driverClassName=com.vmware.sqlfire.jdbc.ClientDriver
11 | jdbc.sqlfire.url=jdbc:sqlfire://localhost:1527
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/WEB-INF/jsp/spring/Category.jsp:
--------------------------------------------------------------------------------
1 | <%@ include file="IncludeTop.jsp" %>
2 |
3 |
4 |
5 | "> << Main Menu
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
32 |
33 | <%@ include file="IncludeBottom.jsp" %>
34 |
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/WEB-INF/jsp/spring/Checkout.jsp:
--------------------------------------------------------------------------------
1 | <%@ include file="IncludeTop.jsp" %>
2 |
3 |
4 |
5 |
6 |
7 |
8 | "><< Shopping Cart
9 |
10 |
11 |
12 |
13 |
14 | Checkout Summary
15 |
16 |
17 |
18 |
19 | Item ID Product ID Description In Stock? Quantity List Price Total Cost
20 |
21 |
22 |
23 |
24 |
25 | ">
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 | Sub Total:
48 |
49 |
50 |
51 |
52 |
53 |
54 | << Prev
55 |
56 |
57 | Next >>
58 |
59 |
60 |
61 | ">
62 |
63 |
64 |
65 |
66 |
67 |
68 | <%@ include file="IncludeBottom.jsp" %>
69 |
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/WEB-INF/jsp/spring/EditAccountForm.jsp:
--------------------------------------------------------------------------------
1 | <%@ include file="IncludeTop.jsp" %>
2 | <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | " method="post">
15 |
16 |
17 | " method="post">
18 |
19 |
20 |
21 |
22 | User Information
23 |
46 |
47 | <%@ include file="IncludeAccountFields.jsp" %>
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
">My Orders
58 |
59 | <%@ include file="IncludeBottom.jsp" %>
60 |
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/WEB-INF/jsp/spring/Error.jsp:
--------------------------------------------------------------------------------
1 | <%@ include file="IncludeTop.jsp" %>
2 |
3 | Error!
4 |
5 |
6 |
7 | <%@ include file="IncludeBottom.jsp" %>
8 |
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/WEB-INF/jsp/spring/IncludeBanner.jsp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/WEB-INF/jsp/spring/IncludeBottom.jsp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
20 | (Currently running on the Spring web tier)
21 |
22 |
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/WEB-INF/jsp/spring/IncludeMyList.jsp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Pet Favorites
7 | Shop for more of your favorite pets here.
8 |
9 |
10 |
11 |
12 | ">
13 |
14 |
15 |
16 | ( )
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | << Prev
25 |
26 |
27 | Next >>
28 |
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/WEB-INF/jsp/spring/IncludeQuickHeader.jsp:
--------------------------------------------------------------------------------
1 |
2 | ">
3 |
4 |
5 | ">
6 |
7 |
8 | ">
9 |
10 |
11 | ">
12 |
13 |
14 | ">
15 |
16 |
17 |
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/WEB-INF/jsp/spring/IncludeTop.jsp:
--------------------------------------------------------------------------------
1 | <%@ page contentType="text/html" %>
2 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
3 | <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
4 | JPetStore Demo
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
43 |
44 | <%@ include file="IncludeQuickHeader.jsp" %>
45 |
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/WEB-INF/jsp/spring/Item.jsp:
--------------------------------------------------------------------------------
1 | <%@ include file="IncludeTop.jsp" %>
2 |
3 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 | Back ordered.
40 |
41 |
42 | in stock.
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 | ">
51 |
52 |
53 |
54 |
55 |
56 | <%@ include file="IncludeBottom.jsp" %>
57 |
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/WEB-INF/jsp/spring/ListOrders.jsp:
--------------------------------------------------------------------------------
1 | <%@ include file="IncludeTop.jsp" %>
2 |
3 |
4 | My Orders
5 |
6 |
7 | Order ID Date Total Price
8 |
9 |
10 | ">
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 | <%@ include file="IncludeBottom.jsp" %>
20 |
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/WEB-INF/jsp/spring/Product.jsp:
--------------------------------------------------------------------------------
1 | <%@ include file="IncludeTop.jsp" %>
2 |
3 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | Item ID Product ID Description List Price
19 |
20 |
21 |
22 | ">
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 | ">
36 |
37 |
38 |
39 |
40 |
41 |
42 | << Prev
43 |
44 |
45 | Next >>
46 |
47 |
48 |
49 |
50 | <%@ include file="IncludeBottom.jsp" %>
51 |
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/WEB-INF/jsp/spring/SearchProducts.jsp:
--------------------------------------------------------------------------------
1 | <%@ include file="IncludeTop.jsp" %>
2 |
3 |
4 |
5 | "><< Main Menu
6 |
7 |
8 |
9 |
33 |
34 | <%@ include file="IncludeBottom.jsp" %>
35 |
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/WEB-INF/jsp/spring/ShippingForm.jsp:
--------------------------------------------------------------------------------
1 | <%@ include file="IncludeTop.jsp" %>
2 | <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | " method="post">
14 |
15 |
70 |
71 |
72 |
73 |
74 |
75 | <%@ include file="IncludeBottom.jsp" %>
76 |
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/WEB-INF/jsp/spring/SignonForm.jsp:
--------------------------------------------------------------------------------
1 | <%@ include file="IncludeTop.jsp" %>
2 |
3 |
4 |
5 |
6 |
7 |
" method="POST">
8 |
9 |
10 | "/>
11 |
12 |
13 |
31 |
32 |
33 |
34 |
35 | ">
36 |
37 |
38 |
39 |
40 | <%@ include file="IncludeBottom.jsp" %>
41 |
42 |
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/WEB-INF/jsp/struts/Category.jsp:
--------------------------------------------------------------------------------
1 | <%@ include file="IncludeTop.jsp" %>
2 |
3 |
4 |
5 | "> << Main Menu
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
32 |
33 | <%@ include file="IncludeBottom.jsp" %>
34 |
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/WEB-INF/jsp/struts/Checkout.jsp:
--------------------------------------------------------------------------------
1 | <%@ include file="IncludeTop.jsp" %>
2 |
3 |
4 |
5 |
6 |
7 |
8 | "><< Shopping Cart
9 |
10 |
11 |
12 |
13 |
14 | Checkout Summary
15 |
16 |
17 |
18 |
19 | Item ID Product ID Description In Stock? Quantity List Price Total Cost
20 |
21 |
22 |
23 |
24 |
25 | ">
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 | Sub Total:
48 |
49 |
50 |
51 |
52 |
53 |
54 | << Prev
55 |
56 |
57 | Next >>
58 |
59 |
60 |
61 | ">
62 |
63 |
64 |
65 |
66 |
67 |
68 | <%@ include file="IncludeBottom.jsp" %>
69 |
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/WEB-INF/jsp/struts/EditAccountForm.jsp:
--------------------------------------------------------------------------------
1 | <%@ include file="IncludeTop.jsp" %>
2 | <%@ taglib prefix="html" uri="http://jakarta.apache.org/struts/tags-html" %>
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | User Information
11 |
12 |
13 | User ID:
14 |
15 | New password:
16 |
17 | Repeat password:
18 |
19 |
20 |
21 | <%@ include file="IncludeAccountFields.jsp" %>
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
">My Orders
32 |
33 | <%@ include file="IncludeBottom.jsp" %>
34 |
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/WEB-INF/jsp/struts/Error.jsp:
--------------------------------------------------------------------------------
1 | <%@ include file="IncludeTop.jsp" %>
2 |
3 | Error!
4 |
5 |
6 |
7 | <%@ include file="IncludeBottom.jsp" %>
8 |
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/WEB-INF/jsp/struts/IncludeAccountFields.jsp:
--------------------------------------------------------------------------------
1 | Account Information
2 |
3 |
4 |
5 | First name:
6 |
7 |
8 | Last name:
9 |
10 |
11 | Email:
12 |
13 |
14 | Phone:
15 |
16 |
17 | Address 1:
18 |
19 |
20 | Address 2:
21 |
22 |
23 | City:
24 |
25 |
26 | State:
27 |
28 |
29 | Zip:
30 |
31 |
32 | Country:
33 |
34 |
35 |
36 | Profile Information
37 |
38 |
39 |
40 | Language Preference:
41 |
42 |
43 |
44 |
45 | Favourite Category:
46 |
47 |
48 |
49 |
50 | Enable MyList
51 |
52 | Enable MyBanner
53 |
54 |
55 |
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/WEB-INF/jsp/struts/IncludeBanner.jsp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/WEB-INF/jsp/struts/IncludeBottom.jsp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
20 | (Currently running on the Struts web tier)
21 |
22 |
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/WEB-INF/jsp/struts/IncludeMyList.jsp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Pet Favorites
7 | Shop for more of your favorite pets here.
8 |
9 |
10 |
11 |
12 | ">
13 |
14 |
15 |
16 | ( )
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | << Prev
25 |
26 |
27 | Next >>
28 |
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/WEB-INF/jsp/struts/IncludeQuickHeader.jsp:
--------------------------------------------------------------------------------
1 |
2 | ">
3 |
4 |
5 | ">
6 |
7 |
8 | ">
9 |
10 |
11 | ">
12 |
13 |
14 | ">
15 |
16 |
17 |
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/WEB-INF/jsp/struts/IncludeTop.jsp:
--------------------------------------------------------------------------------
1 | <%@ page contentType="text/html" %>
2 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
3 | <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
4 |
5 | JPetStore Demo
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
44 |
45 | <%@ include file="IncludeQuickHeader.jsp" %>
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/WEB-INF/jsp/struts/Item.jsp:
--------------------------------------------------------------------------------
1 | <%@ include file="IncludeTop.jsp" %>
2 |
3 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 | Back ordered.
40 |
41 |
42 | in stock.
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 | ">
51 |
52 |
53 |
54 |
55 |
56 | <%@ include file="IncludeBottom.jsp" %>
57 |
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/WEB-INF/jsp/struts/ListOrders.jsp:
--------------------------------------------------------------------------------
1 | <%@ include file="IncludeTop.jsp" %>
2 |
3 |
4 | My Orders
5 |
6 |
7 | Order ID Date Total Price
8 |
9 |
10 | ">
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 | <%@ include file="IncludeBottom.jsp" %>
20 |
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/WEB-INF/jsp/struts/NewAccountForm.jsp:
--------------------------------------------------------------------------------
1 | <%@ include file="IncludeTop.jsp" %>
2 | <%@ taglib prefix="html" uri="http://jakarta.apache.org/struts/tags-html" %>
3 |
4 |
5 |
6 |
7 |
8 |
9 | User Information
10 |
11 |
12 | User ID:
13 |
14 | New password:
15 |
16 | Repeat password:
17 |
18 |
19 |
20 | <%@ include file="IncludeAccountFields.jsp" %>
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 | <%@ include file="IncludeBottom.jsp" %>
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/WEB-INF/jsp/struts/NewOrderForm.jsp:
--------------------------------------------------------------------------------
1 | <%@ include file="IncludeTop.jsp" %>
2 | <%@ taglib prefix="html" uri="http://jakarta.apache.org/struts/tags-html" %>
3 |
4 |
5 |
6 |
7 |
8 | Payment Details
9 |
10 | Card Type:
11 |
12 |
13 |
14 |
15 |
16 | Card Number: * Use a fake number!
17 |
18 |
19 | Expiry Date (MM/YYYY):
20 |
21 |
22 | Billing Address
23 |
24 |
25 |
26 | First name:
27 |
28 |
29 | Last name:
30 |
31 |
32 | Address 1:
33 |
34 |
35 | Address 2:
36 |
37 |
38 | City:
39 |
40 |
41 | State:
42 |
43 |
44 | Zip:
45 |
46 |
47 | Country:
48 |
49 |
50 |
51 | Ship to different address...
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 | <%@ include file="IncludeBottom.jsp" %>
61 |
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/WEB-INF/jsp/struts/Product.jsp:
--------------------------------------------------------------------------------
1 | <%@ include file="IncludeTop.jsp" %>
2 |
3 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | Item ID Product ID Description List Price
19 |
20 |
21 |
22 | ">
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 | ">
36 |
37 |
38 |
39 |
40 |
41 |
42 | << Prev
43 |
44 |
45 | Next >>
46 |
47 |
48 |
49 |
50 | <%@ include file="IncludeBottom.jsp" %>
51 |
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/WEB-INF/jsp/struts/SearchProducts.jsp:
--------------------------------------------------------------------------------
1 | <%@ include file="IncludeTop.jsp" %>
2 |
3 |
4 |
5 | "><< Main Menu
6 |
7 |
8 |
9 |
33 |
34 | <%@ include file="IncludeBottom.jsp" %>
35 |
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/WEB-INF/jsp/struts/ShippingForm.jsp:
--------------------------------------------------------------------------------
1 | <%@ include file="IncludeTop.jsp" %>
2 | <%@ taglib prefix="html" uri="http://jakarta.apache.org/struts/tags-html" %>
3 |
4 |
5 |
6 |
7 |
8 | Shipping Address
9 |
10 |
11 |
12 | First name:
13 |
14 |
15 | Last name:
16 |
17 |
18 | Address 1:
19 |
20 |
21 | Address 2:
22 |
23 |
24 | City:
25 |
26 |
27 | State:
28 |
29 |
30 | Zip:
31 |
32 |
33 | Country:
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 | <%@ include file="IncludeBottom.jsp" %>
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/WEB-INF/jsp/struts/SignonForm.jsp:
--------------------------------------------------------------------------------
1 | <%@ include file="IncludeTop.jsp" %>
2 |
3 |
4 |
5 |
6 |
7 | " method="POST">
8 |
9 |
10 | "/>
11 |
12 |
13 |
31 |
32 |
33 |
34 |
35 | ">
36 |
37 |
38 |
39 |
40 | <%@ include file="IncludeBottom.jsp" %>
41 |
42 |
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/WEB-INF/log4j.properties:
--------------------------------------------------------------------------------
1 | # For JBoss: Avoid to setup Log4J outside $JBOSS_HOME/server/default/deploy/log4j.xml!
2 | # For all other servers: Comment out the Log4J listener in web.xml to activate Log4J.
3 | log4j.rootLogger=INFO, stdout, logfile
4 |
5 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender
6 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
7 | log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - %m%n
8 |
9 | log4j.appender.logfile=org.apache.log4j.RollingFileAppender
10 | log4j.appender.logfile.File=${petstore.root}/WEB-INF/petstore.log
11 | log4j.appender.logfile.MaxFileSize=512KB
12 | # Keep three backup files.
13 | log4j.appender.logfile.MaxBackupIndex=3
14 | # Pattern to output: date priority [category] - message
15 | log4j.appender.logfile.layout=org.apache.log4j.PatternLayout
16 | log4j.appender.logfile.layout.ConversionPattern=%d %p [%c] - %m%n
17 |
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/WEB-INF/mail.properties:
--------------------------------------------------------------------------------
1 | # Properties file with mail-related settings, used for scheduled info emails.
2 | # Applied by PropertyPlaceholderConfigurer from "applicationContext.xml".
3 | # Targeted at system administrators, to avoid touching the context XML files.
4 |
5 | mail.host=
6 |
7 |
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/WEB-INF/remoting-servlet.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/WEB-INF/server-config.wsdd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 | http://xml.apache.org/axis/wsdd/
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/banner_birds.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/banner_birds.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/banner_cats.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/banner_cats.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/banner_dogs.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/banner_dogs.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/banner_fish.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/banner_fish.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/banner_reptiles.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/banner_reptiles.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/bird1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/bird1.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/bird1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/bird1.jpg
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/bird2.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/bird2.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/bird2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/bird2.jpg
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/bird3.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/bird3.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/bird4.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/bird4.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/bird5.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/bird5.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/bird6.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/bird6.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/birds_icon.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/birds_icon.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/bkg-sidebar.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/bkg-sidebar.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/bkg-topbar.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/bkg-topbar.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/button_add_to_cart.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/button_add_to_cart.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/button_checkout.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/button_checkout.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/button_continue.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/button_continue.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/button_next.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/button_next.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/button_prev.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/button_prev.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/button_previous.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/button_previous.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/button_proceed.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/button_proceed.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/button_register_now.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/button_register_now.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/button_remove.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/button_remove.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/button_submit.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/button_submit.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/button_update_cart.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/button_update_cart.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/cart.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/cart.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/cartHL.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/cartHL.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/cat1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/cat1.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/cat1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/cat1.jpg
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/cat2.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/cat2.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/cat2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/cat2.jpg
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/cat3.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/cat3.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/cat4.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/cat4.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/cats_icon.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/cats_icon.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/dog1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/dog1.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/dog1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/dog1.jpg
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/dog2.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/dog2.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/dog2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/dog2.jpg
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/dog3.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/dog3.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/dog3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/dog3.jpg
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/dog4.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/dog4.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/dog4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/dog4.jpg
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/dog5.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/dog5.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/dog5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/dog5.jpg
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/dog6.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/dog6.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/dog6.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/dog6.jpg
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/dogs.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/dogs.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/dogs_icon.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/dogs_icon.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/fish.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/fish.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/fish1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/fish1.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/fish1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/fish1.jpg
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/fish2.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/fish2.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/fish2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/fish2.jpg
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/fish3.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/fish3.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/fish3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/fish3.jpg
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/fish4.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/fish4.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/fish4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/fish4.jpg
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/fish_icon.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/fish_icon.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/help.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/help.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/helpHL.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/helpHL.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/lizard1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/lizard1.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/lizard1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/lizard1.jpg
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/lizard2.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/lizard2.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/lizard3.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/lizard3.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/logo-topbar.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/logo-topbar.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/my_account.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/my_account.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/my_accountHL.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/my_accountHL.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/poweredBySpring.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/poweredBySpring.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/poweredby.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/poweredby.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/reptiles_icon.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/reptiles_icon.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/search.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/search.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/separator.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/separator.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/sign-in.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/sign-in.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/sign-inHL.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/sign-inHL.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/sign-out.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/sign-out.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/sign-outHL.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/sign-outHL.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/sm_birds.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/sm_birds.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/sm_cats.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/sm_cats.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/sm_dogs.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/sm_dogs.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/sm_fish.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/sm_fish.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/sm_reptiles.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/sm_reptiles.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/snake1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/snake1.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/snake1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/snake1.jpg
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/images/splash.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-sqlfire-samples/dd72d5320dd432efd4ce9c39dfeecff72b0a4796/jpetstore/src/main/webapp/images/splash.gif
--------------------------------------------------------------------------------
/jpetstore/src/main/webapp/index.html:
--------------------------------------------------------------------------------
1 | JPetStore Demo
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
12 |
15 |
16 |
17 |
18 |
19 |
24 |
25 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 | Welcome to the Spring JPetStore, by Juergen Hoeller
38 |
39 |
40 | This application demonstrates the use of Spring for the middle tier,
41 | including declarative transaction management applied to POJO
42 | business objects. This application can easily be configured to use
43 | JTA or JDBC for transaction management, so it allows declarative
44 | transaction management in a web container without JTA.
45 | There are alternative Spring and Struts MVC layers built on
46 | a shared Spring middle tier.
47 |
48 |
49 | Enter the Store
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
72 |
73 |
74 |
75 |
76 |
--------------------------------------------------------------------------------