Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

file access in web application

 
yashendra chandrakar
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello
friends,
i were developing a web application using jsp.i made following directroy hierarchy in context root of my web application
context-root/images(image files folder)
context-root/index.jsp(specified in web.xml as welcome-file)
context-root/WEB-INF/web.xml
context-root/WEB-INF/classes/productDetail.jsp
context-root/WEB-INF/classes/registration.jsp
1)i have to make a link in index.jsp for accessing productDetail.jsp.
now, how to specify path for this in html tag <A HREF= >

2)i'm using a javascript file & a html file with registration.jsp,
where should i put these javascript & html files
i have not specified these jsp files in web.xml using <servlet> <jsp-file> tags
thanx in advance
Yashendra.
 
mustang india
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I dont understand why u have put the JPSs in the classes directory. As far as my knowledge goes, they have to be in context-root/xxx.jsp, along with ur index.jsp.
U can access them as "/context-root/xxx.jsp"
All ur HTML files should be in ur context-root.
JavaScript files can be in the same directory or can go into any directory just as u have donw with ur images. This is optional.
I hope this caters ur need.
Mustang.
 
yashendra chandrakar
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
mustang,
what u r saying is absolutely fine.it works perfectly when i put all files in context root of my server,but this way it will be part of default web application,and then same ServletContext object w'll be shared with other applications, which are part of default application.what i want is to deploy my project as separate web application
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13074
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look at the examples that come with Tomcat or download the servlet API from java.sun.com to see how to set up a separate "web application" - it really is very simple.
Bill
 
yashendra chandrakar
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanx
mustang & William,
i tried as mustang said,now its working with some extent,but still facing problem.
i have registered web application in my weblogic server as follows-
weblogic.httpd.webapp.yash=
/weblogic/myserver/mywebsite
(its perfectly all right)
so here my web application name or context name is "yash"
context-root is
/weblogic/myserver/mywebsite
i have all jsp files in mywebsite folder suppose
mywebsite/shoppingCart.jsp
mywebsite/procedeOrder.jsp
in shoppingCart.jsp,i'm using
<jsp:forward path='procedeOrder.jsp'/>
but it says resource '/yash/procedeOrder.jsp' not
found in context-root /weblogic/myserver/mywebsite
But same code is working in default context of server.can u tell me any link, where i can get information about making web application using jsp.
thanx.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic