jakarta-taglibs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marco.Mistr...@nokia.com
Subject RE: HELP! problem with jsp tags and variable substitution
Date Thu, 27 Jul 2000 11:53:14 GMT
HI Mike,
	as i already replied, i found an alternative...i use the
session...but still i would like to 
put in the attribute  <%= attribute %>

everything works fine if the value is hardcoded

hope that u can help me
regards
	marco	

> -----Original Message-----
> From: EXT Michael Taylor [mailto:mdt@qad.com]
> Sent: 27. July 2000 11:19
> To: Marco.Mistroni@nokia.com
> Cc: taglibs-dev@jakarta.apache.org
> Subject: Re: HELP! problem with jsp tags and variable substitution
> 
> 
> 
> 
> 
> Marco,
> 
> Maybe I'm way off here, but I think you need to set an 
> attribute in the
> taglib to enable evaluation of JSP tags within attributes of 
> your tag.  I
> believe it would look like this:
> 
>           <attribute>
>                <name>xslfile</name>
>                <required>true</required>
>                <rtexprvalue>true</rtexprvalue>
>           </attribute>
> 
> Someone please correct me if I'm wrong in my understanding of 
> rtexprvalue,
> but I'm pretty sure it enables parsing of some JSP 
> directives.  I don't
> think
> this means other tags, but I do think it means things like <% 
> ... %>.  I
> have done this successfully I think using <% %> but never 
> tried <%= %>.
> 
> - Mike
> 
> 
> 
> 
> 
> 
> Marco.Mistroni@nokia.com on 07/27/2000 01:08:05 AM
> 
> To:   taglibs-dev@jakarta.apache.org
> cc:   sergek@lokitech.com, Michael Taylor/QAD1
> 
> Subject:  HELP! problem with jsp tags and variable substitution
> 
> 
> 
> 
> hi all,
>      i wrote a JSP with custom tags for translating XML into 
> either HTML
> or WML
> the page is like this:
> 
> <%@ 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