• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

My *.jsp files will not execute unless in /servlet path.

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On the hosting service, the path http://jsemler.net/jws/Calculator.jsp invokes my Java webstart Calculator application.

But Apache2.2 web server can't pass "http://localhost/jws/Calculator.jsp" for processing to the Tomcat 6 server on my local test machine.

My httpd.conf file has the following lines:



This is what the hosting service has to say about mount directives:

Under the shared Apache/Tomcat implementation as we have here (per Apache’s specifications and industry-standard for a shared platform), all requests go through Apache first, and as such, specific mount directives have to be defined in Apache to pass the JSP/Servlet/Mapping from Apache to Tomcat (otherwise Apache will assume it should try processing the request). By default, the directives we pass are:

We pass the three standard mount directives:

*.jsp
/servlet/*
/servlets/*



How do I configure the my local Apache/Tomcat system to behave more like the hosting service?

(I struggled for far to long with this, I'm not an expert with Apache/Tomcat configuration and may be looking at the wrong things)

Thanks!
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Probably the reason "http://localhost/jws/Calculator.jsp" does not execute is that your local Tomcat does not think that "jws" is a legal web application.

Study the way the applications that Tomcat comes with are configured.

Bill
 
John Semler
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

William Brogden wrote:Probably the reason "http://localhost/jws/Calculator.jsp"; does not execute is that your local Tomcat does not think that "jws" is a legal web application.

Study the way the applications that Tomcat comes with are configured.

Bill



You got me thinking what was really happening at the hosting service implementation. The clue was that the WEB-INF directory appears inside my "httpdocs" directory. They do not allow users to upload war files for a reason:


Support Center » Knowledgebase » Tomcat (JSPs/Servlets) » Are .war files supported on your servers?

Solution In our shared Apache/Tomcat implementation, .war files are not supported (noted on our main website). You must unarchive your .war into your httpdocs directory. The container-standard /WEB-INF directory structure is preprovided.
...



My "jws" directory along with all the web files are loaded into the httpdocs directory.

On my localhost, I made junctions back into my WebContent development directories.

First, I shutdown the Apache and Tomcat service. Then renamed the Tomcat directories "webapp/ROOT" to "webapp/ROOT.bu' and "webapp/servlet" to "webapp/servlet.bu" to get them out of the way.

These are the commands I used to establish links back to my WebContent development directory:



Then I copy the files from the renamed servlet.bu into D:\home\jsemler.net\WebContent and restart the Apache and Tomcat installation.

http://localhost/jws/Calculator.jsp now works under my system.

Not an elegant solution but it works. I would also lose my Tomcat Manager Web page and the ability to use war files (because I took over "ROOT"). I only possess rudimentary knowledge of how to configure Apache/Tomcat/Windows 7 system so my chances are low in finding a better solution without investing a lot of time.

Thanks!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!