Discussions

Web tier: servlets, JSP, Web frameworks: .do expressions the brower

  1. .do expressions the brower (3 messages)

    Hi,

    i have a small problem with struts actions.

    When i call a Action, for example Login.do, and this Action calls a site, e.g. login.jsp, in the Browser navigation bar always stands the ..../Login.do, instead the login.jsp.

    I call the login.jsp in the Login-Action with
    mapping.findForward(login.jsp)

    How can i provide that the Browser shows the jsp-site in the nav bar and not the Action name?

    Thx Naggi
  2. <action>
      path= "/somerequest"
      type="com.somepackage.someAction"
      scope="request"
      name="someForm"
      validate="true"
      input="somejsp.jsp"
      <forward name="Success" path="/action/xys" redirect="true"/>
      <forward name="Failure" path="/somejsp.jsp" redirect="true"/>
    </action>
  3. But this has disadvantage, that all request attributes have to be put into session!!

    And it is not good practise. Why would like you to show the jsp?
  4. .do expressions the brower[ Go to top ]

    change .do to whatever you want. Modify your web.xml to foward requests *.htm or *.xyz or whatever. Then the users type that into the browser bar and it is sent as your struts action. Otherwise, maybe use a response redirect after processsing. There's no good technical reason not to show the users the .do extension in the browser as far as I can figure. So maybe allowing them to type in something more familiar and forward that to struts is what you're looking for.