• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem in accessing a jsp file from another folder

 
Ranch Hand
Posts: 51
Netbeans IDE Oracle Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello everybody....my question may seems to pretty ordinary to many of you....but as a beginner I am unable to find a solution.....so please help me.

I am using netbeans 7.2. I have created a project, the project hierarchy looks like the following:

FolderDemo
|
|__build
|__dist
|__nbproject
|__src
|__web
|__Folder1
| |__abc.jsp
|
|__Folder2
| |__xyz.jsp
|
|__WEB-INF


Now, my problem relates to abc.jsp and xyz.jsp files. What I am trying to do is that I am trying to access abc.jsp from xyz.jsp.

Here is the code for xyz.jsp:

Now If I right click on xyz.jsp and select run from the pop up menu, it works.....I mean xyz.jsp is coming and when i click on the hyperlink abc.jsp is also coming.
But If I run the project in normal way by clicking on Run button then when i click on the hyperlink on xyz.jsp, abc.jsp is not coming.....instead its giving Http 404 error message.
I don't know what to do? please help me.
 
Ranch Hand
Posts: 440
Hibernate Eclipse IDE Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Sujoy Mukherjee,

The project structure looks okay to me , so does the JSP and the href tag. It should work fine. Can you please tell me what link do you use to access the site on the browser ? Must be something similar to localhost:8080/FolderDemo/ ?
 
Sujoy Mukherjee
Ranch Hand
Posts: 51
Netbeans IDE Oracle Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Saif,
Thanks for replying.
yes you are absolutely right.....when i am running the project the browser shows http://localhost:8080/FolderDemo/.
Then when i click on the hyperlink, it is showing

HTTP Status 404 -

type Status report

message

descriptionThe requested resource () is not available.

while the browser shows http://localhost:8080/Folder1/abc.jsp as the link.

regards,
Sujoy
 
Saif Asif
Ranch Hand
Posts: 440
Hibernate Eclipse IDE Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

http://localhost:8080/Folder1/abc.jsp


It seems that the URL is not appending context name.

Try changing the URL to this



Now the URL formed should be like this

http://localhost:8080/FolderDemo/Folder1/abc.jsp
 
The harder I work, the luckier I get. -Sam Goldwyn So tiny. - this ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic