Java Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesJava Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 14th, 2003, 07:20 PM
Archana Archana is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 18 Archana User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
How To Access a JSP file from other JSP

The following is my webapplication directory structure.

C:\Tomcat4.1\webapps\IS_Project
-WEB-INF
-JSP
home.jsp,search.jsp....
WEB-INF

I can access the search.jsp
http://localhost:8080/IS_Project/jsp/search.jsp like this

My home.jsp contains simple form data , in the form action i am calling search.jsp
I tried all these
<form action="search.jsp">,<form action="/jsp/search.jsp">, <form action="IS_Project/jsp/search.jsp">

For all these I am getting(depending on what I gave in the action)

HTTP Status 404 - /IS_Project/jsp/search.jsp

type Status report

message /IS_Project/jsp/search.jsp

description The requested resource (/IS_Project/jsp/search.jsp) is not available.

Apache Tomcat/4.1.18

I know I am missing some thing here ,please somebody help me in how to call the JSP file.Do I need to add anything in the web.xml?

I really appreciate anykind of help.

Archana

Reply With Quote
  #2  
Old March 15th, 2003, 05:05 PM
StinkFist StinkFist is offline
Cthulu-ish
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2002
Location: Seattle
Posts: 31 StinkFist User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
try this:

Code:
<form action="/IS_Project/jsp/search.jsp">


should work
__________________

Reply With Quote
  #3  
Old March 15th, 2003, 06:08 PM
Nemi Nemi is offline
Clueless llama
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Feb 2001
Location: Lincoln, NE. USA
Posts: 2,353 Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 2 Days 12 h 35 m 19 sec
Reputation Power: 111
If you want to get the web app name without hard coding it in (in case you ever monve thi to a web app that has a different name) you can use

Code:
<form action="<%= request.getContextPath() %>/jsp/search.jsp">


That way if you hav a hundred files and you change the name of the web app to IT_Project, then you don't have to touch each page.

Reply With Quote
  #4  
Old March 17th, 2003, 07:25 AM
Archana Archana is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 18 Archana User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thank You , i will try those two.

Archana

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesJava Help > How To Access a JSP file from other JSP


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT