Discussions

Web tier: servlets, JSP, Web frameworks: Skip Action in Struts

  1. Skip Action in Struts (2 messages)

    Hello

       I am new to Struts. And I got a question.
    As my understanding. With Struts the two parts "Action" first then "View". and the forward joint them. It is that loose.

       But what happen if the browser request the view directly, then "Action" has been skipped. So without action beans can not been access.

    As I try the struts-example. put "http://localhost:8080/struts-example/registration.jsp"
    then got
    "javax.servlet.ServletException: No bean found under attribute key registrationForm"

    For me there are two questions.
    First how to access a page jsp can show some action information but not breake the MVC model.

    Second How to prevent others to access the "view" Jsp page directly or I need do the somethings like <app:checkLogon/> every page.

    Thanks for any help .

    Tix

    Threaded Messages (2)

  2. Skip Action in Struts[ Go to top ]

    I dont quite understand the first question.

    One option for the second question is to put your JSP's in a floder under your WEB-INF folder. They are not directly accessible there.
  3. Skip Action in Struts[ Go to top ]

    Hello,

    i think you must call:
    http://localhost:8080/struts-example/registration.do

    and you will execute the perform(or execute) méthod of
    the action class.

    @+
    Seb