Hmmm, you would think the code below would work - since I AM getting
"/pages/index.jsp" as a value - but I get the following error:
java.lang.IllegalArgumentException: Cannot URL decode request path /<%=xmlJsp%>
--- Matt Raible <[EMAIL PROTECTED]> wrote:
> I've figured out a pretty slick (I think) way to use XSL have one page that
> changes the look and feel of my entire application. Basically, I put all my
> XML JSP's in a "pages" directory - and all they really contain is title,
> heading, and form elements (populated by bean:write and html:form). All
> "layout" is controlled by a CSS stylesheet (I'm only supporting
> standards-compliant browsers - and client agrees ;).
>
> So my "rough" solution at this point is to route all requests for JSP's to a
> JSP (with the same name in the / directory). So I have a JSP Transformer for
> each JSP XML page. I'd like to just have one page that does the
> transformation.
>
> However, there's GOT to be an easier way. You would think it would be easy
> to
> create a URL-mapping for this - or something like that. I would like it
> would
> be easy to create a <url-pattern> of *.jsx that would route to a
> htmlTransform.jsp page. Is this the best way? I really like the idea of
> using
> JSP's to get messages and form values - seems pretty easy. If there is a way
> of using a servlet in place of the htmlTransform.jsp - that might be a good
> idea...
>
> Thanks,
>
> Matt
>
>
> web.xml ---------
> <!-- XSLT Tranformer -->
> <servlet>
> <servlet-name>xslt</servlet-name>
> <jsp-file>/htmlTransform.jsp</jsp-file>
> </servlet>
> <!-- XSLT Mapping -->
> <servlet-mapping>
> <servlet-name>xslt</servlet-name>
> <url-pattern>*.jsx</url-patter>
> </servlet-mapping>
>
> htmlTransform.jsp ----------------------
>
> <%@ page language="java" %>
> <%@ taglib uri="/WEB-INF/c.tld" prefix="c" %>
> <%@ taglib uri="/WEB-INF/x.tld" prefix="x" %>
>
> <%
> String xmlJsp = request.getServletPath();
> xmlJsp = "/pages" + xmlJsp.substring(0,xmlJsp.indexOf(".")) + ".jsp";
> System.out.println("xmlJsp = " + xmlJsp);
>
> %>
>
> <c:import url="<%=xmlJsp%>" var="xml"/>
> <c:import url="/styles/xsl-xhtml.jsp" var="xslt"/>
> <x:transform source="$xml" xslt="$xslt"/>
>
> __________________________________________________
> Do You Yahoo!?
> Send FREE video emails in Yahoo! Mail!
> http://promo.yahoo.com/videomail/
>
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
>
__________________________________________________
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>