Results 1 to 6 of 6
  1. #1
    SomeoneHere is offline Member
    Join Date
    Jan 2012
    Posts
    9
    Rep Power
    0

    Default Why actions in url?

    Hi

    I have simple login page. After pressing submit button proper page (loginSuccessed.jsp) is displayed, but url is different.
    Why do I have url http://localhost:8080/project/doLogin.action? Shouldn't be (and if yes, how can I get this) http://localhost:8080/project/loginSuccessed.jsp?


    Regards

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,049
    Rep Power
    20

    Default Re: Why actions in url?

    Presumably because your application (correctly) forwards to that JSP, as defined in your struts.xml?

  3. #3
    SomeoneHere is offline Member
    Join Date
    Jan 2012
    Posts
    9
    Rep Power
    0

    Default Re: Why actions in url?

    Hmm it seems I don't understand something. So it's not possible to get in url jsp page? It will always be action?

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,049
    Rep Power
    20

    Default Re: Why actions in url?

    That's how Struts works.
    You submit to an action, which then forwards to a JSP to display the results (OK, Ajaxxy things work slightly differently).
    Since the action and JSP are normally fairly closely associated I don't see why you'd want the JSP page in particular?

  5. #5
    SomeoneHere is offline Member
    Join Date
    Jan 2012
    Posts
    9
    Rep Power
    0

    Default Re: Why actions in url?

    Thank you for explanation. It seems clear now. But is it possible to hide url? So that only http://localhost/myProject/ is displayed all the time? I really don't want to have actions in url...

  6. #6
    ahmadzia is offline Member
    Join Date
    Jan 2012
    Posts
    3
    Rep Power
    0

    Default Re: Why actions in url?

    One quick way is to use iframe. Set the first page (default.html or whatever) as default in IIS and use the markup in default.html like

    <body style="margin:0">
    <iframe border="0" height="100%" width="100%" src="home.html" />
    </body>

    Hope that helps.

Similar Threads

  1. Actions
    By What2do in forum New To Java
    Replies: 4
    Last Post: 01-31-2011, 04:45 PM
  2. actions for buttons
    By steel in forum AWT / Swing
    Replies: 1
    Last Post: 12-02-2010, 05:42 AM
  3. JSP standard actions
    By subhashis_mohanty in forum JavaServer Pages (JSP) and JSTL
    Replies: 2
    Last Post: 11-27-2010, 07:35 AM
  4. How to Use Actions
    By AJArmstron@aol.com in forum New To Java
    Replies: 4
    Last Post: 04-18-2010, 09:03 PM
  5. Actions
    By alley in forum AWT / Swing
    Replies: 2
    Last Post: 01-16-2008, 02:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •