• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 239
  • Last Modified:

HTML URL

Hi,

I develop J2EE Web Application. I am using Struts and Hibernate. So, after the login page, I move to the main.jsp. However, the URL is unfortunately similar like http://localhost/Global/login/LoginAction.do;jsessionid=D0DB639AF9F4330E7B41D104B4978037?action=LogIn. So when I refresh the page, it actually tries to log in again. I do not want it to happen. What I want is that when user is in main.jsp after login, when he refresh the page, it should refresh main.jsp and not try to log in again.

Is it dummy question? I just feel that I am quite "stupid" these two days :).

Any idea?

regards
Dave
0
suprapto45
Asked:
suprapto45
  • 5
  • 3
1 Solution
 
aozarovCommented:
From login to main.jsp
Use response redirect -> http://www.webmacro.org/ServletRedirectHowTo
instead of forwared.
0
 
suprapto45Author Commented:
Hi aozarov,

However, when I enter my LoginAction.java (Struts), I will have my action to forward to main.jsp. However, it seems that the URL is not exactly main.jsp.

Wait....do you mean that instead of using forward, I used response.redirect on my Action?

Regards
Dave
0
 
aozarovCommented:
Yes.
0
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

 
suprapto45Author Commented:
Mmm...

Let my try my friend. :) Thanks. Will let you know soon.

Regards
Dave
0
 
suprapto45Author Commented:
Hi,

It works great :).

Thanks buddy.

Regards
Dave
0
 
aozarovCommented:
NP. :-)
0
 
aozarovCommented:
Hi suprapto45,

>>  It seems that I am just a small Java programmer to you :).
Why would you say that?

>> How many years have you been involved in Java? Haha just curios :).
Since Java started.. (Ye, I am old, but not that old).

Take care,
Arie.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now