This week's giveaway is in the Spring forum.
We're giving away four copies of Microservices Testing (Live Project) and have Chris Love & Andres Sacco on-line!
See this thread for details.
Win a copy of Microservices Testing (Live Project) this week in the Spring forum!
  • 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
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

URL problem

 
Ranch Hand
Posts: 834
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi, if i want to call a file which located into my web root folder, how to i call it from coding?

let say my web root folder on c:\myweb , and i want to call/invoke a file(callme.jsp) which reside in c:\myweb\callme.jsp , should it be "../callme.jsp" ? but tomcat generate error like "not start symbol "/""

thank you !
[ October 29, 2004: Message edited by: Alvin chew ]
 
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'll give 2 examples to call a JSP or servlet from within a JSP.

The first example
<TD><A HREF="index.jsp" class="navigatie">Terug naar startscherm</A></TD>

So, if you're calling a JSP from another JSP which is in the same folder, nog need to add a /.

Second example :
<A href="/eddi/servlets/getConduitsServlet?contractNumber=<%=contract.getContractNumber()%>"
target="_parent">

This one calls a servlet from within a JSP. The JSP is located in C:\Program Files\Apache Group\Tomcat 4.1\webapps\eddi.
The servlet is located in C:\Program Files\Apache Group\Tomcat 4.1\webapps\eddi\WEB-INF\classes\org\brukkerlin\servlets.

By writing /eddi, Tomcat knows it has to take a look at the eddi-folder inside the webapps folder. With /servlets and in combination with the web.xml file which mentions the following lines ...
<servlet-mapping>
<servlet-name>org.brukkerlin.servlets.getConduitsServlet</servlet-name>
<url-pattern>/servlets/getConduitsServlet</url-pattern>
</servlet-mapping>

Tomcat knows where to take the necessary class.
 
Alvin chew
Ranch Hand
Posts: 834
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks, Gert , i understand now ..thank you !
 
reply
    Bookmark Topic Watch Topic
  • New Topic