Note that there are some explanatory texts on larger screens.

plurals
  1. POConfigure Restlet to Return JSPs on Google App Engine?
    text
    copied!<p>I have a developed a Restlet application. I would like to return a JSP file on a URL request through Restlet. How can I achieve this without using a redirect?</p> <p>i.e. Let's say I have the file "contact.jsp" on mydomain.com and I want people to be able to access contact.jsp at <a href="http://mydomain.com/contact" rel="noreferrer">http://mydomain.com/contact</a></p> <p>Thus, in Restlet, I would have: </p> <pre><code>router.attach("/contact", MyResource.class); </code></pre> <p>But how can I return the "contact.jsp" page? I know that a redirect would work, but I don't want users to see the ".jsp" in "<a href="http://mydomain.com/contact.jsp" rel="noreferrer">http://mydomain.com/contact.jsp</a>"... or is there another strategy that would work without even using restlet? Maybe some modification of my web.xml file?</p> <p>Edit (2009-08-14):</p> <p>My answer posted below doesn't work on App-Engine and Restlet. It does work however, if I don't include Restlet, or allow Restlet to have a url-pattern of "/*"</p> <p>What would be ideal is to have a subclass of the Router that allows me to do this:</p> <pre><code>router.attach("/contact", "/contact.jsp"); </code></pre> <p>Thanks!</p> <p>Edit (2009-08-17):</p> <p>I'm surprised I haven't had any responses since I posted a bounty. Will someone comment and let me know if my question/problem isn't clear?</p> <p>Edit (2009-08-17):</p> <p>Interesting observation. When using the method described by "Rich Seller" below, it works when deployed on Google App-Engine and not locally. Additionally, If I call <a href="http://mydomain.com/contact.jsp" rel="noreferrer">http://mydomain.com/contact.jsp</a> on Google App-Engine it bypasses Restlet and goes straight to the JSP. But, locally, Restlet takes over. That is, <a href="http://localhost:8080/contact.jsp" rel="noreferrer">http://localhost:8080/contact.jsp</a> does not go to the JSP and goes to Restlet. Do deployed app-engine applications respond differently to URLs as their local counterpart?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload