Re: How to control enforce users to only seeing webpages in sequence?
<f:chukcha> wrote:
Very easy.
You can place those pages inside the invisible WEB-INF folder. No one
can see those pages except your program.... you can forward the request
from page to page...
The MVC (Sun's "Model 2") application architecture would help.
Use servlet mapping to make sure all requests to the app hit the control
servlet. The control servlet will parse the request and determine which logic
to handle it. That logic will run a validate() against the request and report
VALIDATE_FAIL to the servlet if info is missing. The servlet will map that
logic and its result to a forward() back to the requesting page. If validate()
returns a VALIDATE_SUCCESS then the servlet will forward() to the subsequent
page, determined at config time by an external resource, a navigation descriptor.
A side effect is that the user only sees the "official" URL of the control
servlet in their browser address bar, e.g., <www.somesite.com/application/home>.
You can program this by hand or use a framework like Struts.
- Lew