facebook

c:import tag on cross-webapp reference

  1. MyEclipse IDE
  2.  > 
  3. Comments
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #216374 Reply

    ktz
    Member

    – System Setup ——————————-
    Operating System and version: XP Professional
    Eclipse version: 3.0.1
    Eclipse build id:
    Fresh Eclipse install (y/n): y
    If not, was it upgraded to its current version using the update manager?
    Other installed external plugins:
    Number of plugins in the <eclipse>/plugins directory that begin with org.eclipse.pde.*:
    MyEclipse version: 3.8.1
    Eclipse JDK version: 1.4.2
    Application Server JDK version: 1.4.2 – Tomcat 5.0.25
    Are there any exceptions in the Eclipse log file?

    I have servlet “A” forwarding to “a.jsp”. In “a.jsp” I have the following JSTL line :

    <c:import url=”/includes/doingheader.htm” context=”/extemplates/”/>

    but when this runs it produces the following exception :

    javax.servlet.ServletException: Unable to get RequestDispatcher for
    Context: “/extemplates/” and URL: “/includes/doingheader.htm”. Verify
    values and/or enable cross context access.

    “extemplates” is a web project defined in MyEclipse with a folder “includes”.

    How do I allow “a.jsp” to cross reference another project.

    Can someone steer me in the right direction please.

    #216393 Reply

    Riyad Kalla
    Member

    Moving to Random Thoughts, this is a JSTL/Cross-Webapp issue, nothing to do with ME.

    However, what happens when you change your context to not include the trailing slash? Are you sure the webapp “/extemplates” is deployed and running? Check the Tomcat manager to make sure… just to do a sanity check, try and manually load the page that you are trying to invoke the tag on via:

    
    http://localhost:8080/extemplates/includes/doingheader.htm
    

    Did it work? If not, then you have another problem to worry about… maybe you forgot to deploy that project? Maybe Tomcat isn’t starting it up correctly, etc….

    #216586 Reply

    ktz
    Member

    Riyad

    Thank you for your thoughts.

    I got it to work, and it was a Tomcat issue. The answer is to set the crossContext to true. This can be done by setting the context in the server.xml file. Make sure that you set a context for both applications.

    <Context crossContext=”true” docBase=”C:/Java/Tomcat 5.0.25/webapps/extemplates” path=”/extemplates” >
    </Context>
    <Context crossContext=”true” docBase=”C:/Java/Tomcat 5.0.25/webapps/webapp1″ path=”/webapp1″ >
    </Context>

    #216591 Reply

    Riyad Kalla
    Member

    You know, I never knew what that setting did until today, thanks for following up!

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: c:import tag on cross-webapp reference

You must be logged in to post in the forum log in