jakarta-taglibs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marco.Mistr...@nokia.com
Subject FW: HELP! problem with jsp tags and variable substitution
Date Thu, 27 Jul 2000 08:37:38 GMT
hi all,
	i reply with a fast solution (unfortunately not what i want)

so far, a solution that i found stores variables in the session, and in the
java class of the custom tag, using 
pageContext.getSession().getValue(....) i can get the value of an attribute
however, i would like to do what i showed below....
if it can be possible, how can i do that????
htanx in advance & regards
	marco

> <%@ page import="java.util.*"  %>
> <%   String xslfile=null;
>         String format = request.getHeader("User-Agent");
>         System.out.println("the user agent is " + format);
>         if(format.startsWith("Nokia")) {
>             response.setContentType("text/vnd.wap.wml");
>             xslfile = "file:///c:\\marcodev\\provawml.xsl";
>         } else {
>             xslfile="file:///c:\\marcodev\\prova.xsl";
>         }
>  %>
>      
> <%@ taglib uri="http://www.nokia.com/marcotag" prefix="marco" %>
> <?xml version="1.0"?>
> <marco:trialxmltag xsl="<%= xslfile %>">
> <document>
>    <scope></scope>
> </document>
> </marco:trialxmltag>
> 
> 
> When i load hte page i got back the following exception:
> 
> <%= xslfile %>; Line 0; Column 0
> XSL Error: Could not parse <%= xslfile %> document!
> XSL Error: SAX Exception
> There was a SAX Exception!
> org.apache.xalan.xslt.XSLProcessorException: File "<%= 
> xslfile %>" not found.
>         at 
> org.apache.xalan.xslt.XSLTEngineImpl.error(XSLTEngineImpl.java:1630)
>         at 
> org.apache.xalan.xslt.XSLTEngineImpl.processStylesheet(XSLTEngineImpl
> .java:722)
> 
> 
> That means that my JSP page did not substitute <%= xslfile %> !!!!!
> can anyone explain me why????? and how  to solve the problem 
> (without using fixed data)???
> 
> thanx in advance & best regards
> 	marco
> 

Mime
View raw message