Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jsp directory for tomcat !!!

 
sachin dabhade
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello again,
i have configured tomcat for servlets.
i want to know that is it necessary to put the jsp files in example directory only??
i have a directory( say c:\sach ) and want to put my files in it,how can i do that?
what changes shd i have to make??
thanks in advance
sachin
 
Dominic Steng�rd
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Sachin!
Well, as long as you put your JSP pages somewhere under your root directory of Tomcat ('webapps/ROOT'), everything should be fine.
I might have misunderstood your problem, if this is the case I appologize for my simple answer.
Regards

------------------
Dominic Steng�rd
Sun Certified Java 2 Programmer
------------------
 
Udayan Naik
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sachin.It is not necessary to put your jsp files in any particular directory.You will just have to add the necessary context to your tomcat configuration.
For example,I put all my jsp files in a directory
c:\jsptest\udayan\.Then,for tomcat to see these files,i add the necessary Context in the server.xml file in the conf directory of tomcat.

So when u specify the URL
http://localhost:8080/jsp/SomeProgram.jsp
the appropriate SomeProgram.jsp file ,which lies inside c:\jsptest\udayan\ will be executed.
I hope that helps.
[This message has been edited by Udayan Naik (edited March 25, 2001).]
 
hemanth kumar
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sachin
U can put ur JSP files anywhere u desire provided ..
u make the necesary change in the Server.xml file.
Here's a sample.I have changed my directory to C:\ucvs
<Context path="/examples"
docBase="C:\Ucvs\"
crossContext="false"
debug="0"
reloadable="true" >
</Context>
Hope the abv helps
Regds
Hemanth
 
Joel Cochran
Ranch Hand
Posts: 301
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all, SuperNewbieGreenHorn Joel here...
I have also configured Tomcat (standalone on Win9x for now...)for Servlets and have been able to get Servlets to run as desired but have had no luck with .jsps, and I'm sure that this <CONTEXT> thing is it. (what is the docType?)
Silly question though, how do I edit an XML file? When I opened it in NotePad I could read the text, but there were a lot of filled in blocks (which tells me bad characters).
I'll have a lot more questions soon, but if I could get this one answered I could play around a bit first...
Thanks!
------------------
Joel Cochran
[This message has been edited by Joel Cochran (edited March 26, 2001).]
 
maha anna
Ranch Hand
Posts: 1467
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Joel,
The 'web.xml' file is just a text file. All chars should be human readable. I just copy and paste the sampel C:\jakarta-tomcat\webapps\examples\WEB-INF/web.xml file in my machine for your reference. Please check it out.
regds
maha anna
 
hemanth kumar
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Joel Cochran:
Silly question though, how do I edit an XML file? When I opened it in NotePad I could read the text, but there were a lot of filled in blocks (which tells me bad characters).

There is nothing wrong with ur xml file Joel.Just open it with WordPad.U will not get those filled in blocks.
Regds
Hemanth
 
Joel Cochran
Ranch Hand
Posts: 301
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hemanth and Maha Anna...THANKS!
yesyesyesyesyesyesyesyesyes!!!
After a little trial and error I got my first .jsp to work. I forgot that XML is case sensitive, so I got a lot of errors starting Tomcat when I entered "docbase" instead of "docBase", but now I am on my way!
Much thanks!
------------------
Joel Cochran
[This message has been edited by Joel Cochran (edited March 27, 2001).]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic