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

JSPs and Servlets in WAS, without a web application

 
Bala Krishna
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
Is it possible to deploy JSPs and Servlets in WAS, without them being a part of any web application(even default web app). If yes, what is the document root, and how do we specify the URI and such properties for a servlet?
-Bala Krishna
 
Suneel Setlur
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Guess this question has been asked by you earlier and answered.
Any way, you could go to the WebSphere server console, create a virtual host and deploy your JSPs there.
 
Rahul Mahindrakar
Ranch Hand
Posts: 1869
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Suneel you don't deploy your servlets/JSP's in a virtual host. You deploy them in either a servlet container.
Bala,
If you put your servlets in the <WAS_home>/appserver/servlets your servlets will work with http://localhost/servlet/HelloWorldServlet
Where HelloWorldServlet.class is available in the servlets Folder.
If you want to play around with your jsp's then you can put them in
<ibm http server root>/htdocs
 
Bala Krishna
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your answer. I have tried out what you told me about placing JSPs in htdocs. The url I am trying is : http://localhost/htdocs/test.jsp. When this didn't work, I've tried http://localhost/test.jsp. That didn't work either.
What should be the URL for accessing JSPs stored in this directory? We are using IHS 1.3.12 and WAS 3.5.2. What am I doing wrong here? Could you please help me?
 
Tony Chen
Ranch Hand
Posts: 286
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To deploy JSPs, you need to put the JSP files into the "Document Root" of an "Web Application" which is in turn in a "Servlet Engine" of an "Application Server". The /htdocs directory of IHS just serve the static html pages and has nothing to do with WAS.
You MUST setup an "Web Application" to serve JSPs & Servlets.
Try it again! Good luck!
You can find more info about Administer applications here
------------------
Tony Chen
SCJP, ICS & ICSD (WebSphere)
 
Bala Krishna
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tony,
Thanks for answering. That's exactly what I wanted to know - whether or not we can server JSPs without a web application. Looks like this is a short coming in Websphere(to not be able to server JSPs without defining a web app). I already have created web apps and been able to serve JSPs thru that, but wanted to know if I always have to go thru the pain of having a web app. Thanks once again.
-Bala.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic