Link to home
Start Free TrialLog in
Avatar of kwwells
kwwellsFlag for United States of America

asked on

cannot execute a jsp from a subdomain

Hello

I created a subdomain called training.  I am trying to execute a jsp from this subdomain and the jsp does not execute.  The url is http://training.idguild.com/jsptest.jsp.

If I access the jsp from this url it works http://idguild.com/training/jsptest.jsp

I added host entries in the server.xml file for training.idguild.com and restarted the server.  The entries did not correct the problem.
any ideas?

Ken


Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

I think you need to check for DNS server instead, as you need to add a subdomain entry that points training.idguild.com to your Server's IP.
Avatar of kwwells

ASKER

Hi

DNS resolves correctly to http://training.idguild.com/

If I access the jsp from this url http://training.idguild.com/jsptest.jsp  it displays the text in the jsp, but does not execute the jsp.


Since it displays the jsp text, it found the jsp so the url is resolving correctly.

Ken



Avatar of colr__
colr__

You are saying that the JSP doesnt execute, but also that 'it displays the test in the JSP' which are contradicting staements.

What exactly do you see when you try and access the JSP? You would only see the JSP text if it was executing.

If on the other hand, you are seeing partial info from the JSP - check your proxy settings. Is your testing server on your LAN? Do you use a proxy for web access? If so, check that your browser is set to bypass the proxy for the sub domain.

colr__
Avatar of kwwells

ASKER

Hello

1)The statements above are not contradicting, Try executing the two url's below.

The first is the url accessing the jsptest.jsp by the subdomain.  See that it displays the html text but not the results of the jsp code.

http://training.idguild.com/jsptest.jsp 

The second URL is accessing the jsptest.jsp by the domain / directory.  Notice that it prints the same text as the url above but it also returns results of the jsp code. This url works but it is not being accessed by the subdomain.

http://idguild.com/training/jsptest.jsp

2)There are no proxy being used to access the web.

Regards

Ken
Your server is not setup correctly, it is processing JSP pages as html, so its just dumping it onto the screen.

What application server are you using? Is it definetaly a java enabled server?

colr__
Avatar of kwwells

ASKER

Hello

Yes the server is java enabled.  Servlets are installed for our domain.  JSP is definetly working.

The jsp we are using to test this is called jsptest.jsp which is a very simple jsp that will tell you if tomcat is working properly.

If tomcat  is working then the Request Method:  will print GET   and the Servlet path: will print /training/jsptest.jsp

If jsp is not working then these values will be blank.

This is the code.

html><head><title>Test JSP page</title></head><body bgcolor=white>

<table border="0"><tr><td><h1>Sample Application JSP Page</h1>
This is the output of a JSP page that is part of the Hello, World application.
It displays several useful values from the requestwe are currently processing.</td></tr>
</table>

<table border="0" border="100%"><tr>
<th align="right">Request Method:</th>
<td align="left"><%= request.getMethod() %></td></tr><tr>
<th align="right">Servlet Path:</th>
<td align="left"><%= request.getServletPath() %></td></tr></table></body></html>


Ken
ASKER CERTIFIED SOLUTION
Avatar of colr__
colr__

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of kwwells

ASKER

Hello

I figured it out.

I added the following to the httpd.conf for the subdomain and it worked


<IfModule mod_jk.c>
JkMount /*.jsp ajp13
JkMount /servlet/* ajp13
JkMount /servlets/* ajp13
</IfModule>

thanks fo the help

ken