01a - Model1

01a - Model1 - 10/5/2010 Model 1 programming A quick and...

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

View Full Document Right Arrow Icon
10/5/2010 1 “Model 1” programming A quick and naïve way to code web applications with very simple control flow Model 1 thinking Problem: Requests with parameters typically have affect the session, the database & the page they transfer to Solution 1. Think which requests may transfer to called.jsp 2. Start called.jsp with code that collects their request parameters and makes the side effects Jsp scriptlet picks parameters p 1 p 2 updating session & database called.jsp JSP expressions & scriptlets producing the html page calling.jsp p 1 p 2 n 1 n 2 <Form action=“called.jsp”> …/app/called.jsp? n 1 =p 1 n 2 =p 2 …
Background image of page 1

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

View Full DocumentRight Arrow Icon
10/5/2010 2 entry choose order User=… Session product=… amount=… <html> <head><title>Shopping app entry</title></head> <body> Welcome to the tiniest shopping app of the world:<p> < form method="GET" action="choose.jsp" > Your name: <input type="text" size="20" name="user" /><p /> <input type="submit" value="Proceed to Choose products"/> </form> </body> </html> Entry
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 5

01a - Model1 - 10/5/2010 Model 1 programming A quick and...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online