{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Struts Practice (with solution)

Struts Practice (with solution) - Consider an auction web...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Consider an auction web application that provides a page like this and allows the user to bid on an item, specified by an item ID that the user somehow (we do not care how) obtained. Validate the ID is a legit product ID, assuming model.validID() and similarly validate that the dollar amount is indeed a dollar amount (as opposed to, say, a non- numeric string). Upon clicking “Place Bid”, the business logic of the web application uses a given Integer function model.currentHighestBid(String id) to find out what is the highest current bid placed earlier. If the current bid exceeds the highest earlier bid the user is sent to the Page B, a sample of which is displayed below. If it does not (exceed), the user is sent back to Page A, whereas a message like the one shown below also appears.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Upon clicking the “Buy” the business logic invokes a boolean function model.buyWithCard(String CreditCard) , which if it succeeds the customer is sent back to Page A and otherwise he is sent back to Page B and a message “Provide another card” is displayed. Ignore validation of the credit card form.
Background image of page 2
Write a struts program that implements the above. You may use any of the given model functions above. Provide the following pieces: - struts-config.xml (we provide a template in the next page so that you do not write tags by hand) - form beans, including validation (if you decide to use validation in form beans
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}