I am now using
Struts for the development. I have 3 questions about
J2EE pattern by the use of Struts:
1) How can I use Struts to create the Front Controller? In the book
descibing Front Controller, it is a
servlet file which receives the request
and then dispatches to the appropriate view according to the request.
However, in using Struts, should I use the same way? However, I found that
in using Struts, I can call the controller class which subclass
ActionServlet, all the views forwarded are declared in the
struts-config.xml. Am I right in this method?
2) In the project, there is a Front Controller which dispatches the request
to the appropriate view (
jsp file). Of course, I use Struts to do this.
However, I expect that the user is impossible for going to the view (jsp
page) directly by typing the address of the jsp file. I hope that the user
can go to the view through the controller only. How can I do this?
3) There is a problem by using browser - when a user browses a site, he can
press the 'back' button to the previous page, and then click the 'forward'
button also. How can I prevent this by using Struts? I found that in some
sites, when the user clicks the 'back' button, an error page displays. How
can I do this? Thanks!
Many Thanks!
Stephen