File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes JSP link not working on first run Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "JSP link not working on first run" Watch "JSP link not working on first run" New topic

JSP link not working on first run

KeshavSharma Sharma

Joined: Mar 24, 2013
Posts: 2
Here is my login.jsp page:

Here when I load this page for the first time the image as well as the link to another jsp with div id ="changePasswordLinkId" doesn't work. The image is not shown and clicking the anchor link displays the login page again.however if I login once and use the back button of the browser they work. Please help me on this. I will be very thankful. Thanks In advance.

Ashwini Kashyap
Ranch Hand

Joined: Aug 30, 2012
Posts: 90
I don't see any kind of problem in your code.

Just make sure you place your content like jsp's and images under Webcontent directory structure. It should work for you.

Ashwini Kashyap |
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 60041

Ashwini Kashyap wrote:... under Webcontent directory structure

be aware that "Webcontent" is an Eclipse convention and is not a real folder specified by the Servlet Specification. You will not have this folder unless using eclipse. Rather, you will have a context root folder,(usually named the same as the context path, but which can be named pretty much anything.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Ashwini Kashyap
Ranch Hand

Joined: Aug 30, 2012
Posts: 90
Yes you are right Bear :-)

I agree. Here's the link:
subject: JSP link not working on first run
Similar Threads
PHP in General
wrong jar reference
utf-8 data with get method not working but post method working.
how to get utf-8 data from query string in JSP
http 404 error in uploading the file