Are you using a JSP 2.0 container (like Tomcat 5)? If not, you can't use JSTL
1.1, you have to use JSTL 1.0. For a quick sanity check, what do you get with
the following:

<h1>JSTL: <c:out value="${lvform.map.method}"/></h1>
<h1>Struts: <bean:write name="lvform" property="method"/></h1>

If you really are using a JSP 2.0 container, you can also try:

<h1>JSP: ${lvform.map.method}</h1>

Also make sure you're using a Servlet 2.4 deployment descriptor:

<web-app xmlns="http://java.sun.com/xml/ns/j2ee";
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";
         version="2.4">
  ...
</web-app>

Quoting Alexander Kirsch <[EMAIL PROTECTED]>:

> Hallo all,
> 
> I have some problems with the JSTL 1.1 (From SUN jwsdp 1.3) Tags together
> with
> Struts 1.1 DynaValidatorForms.
> 
> I have defined the following DynaValidatorForm:
> 
> <form-bean name="lvForm"
> type="org.apache.struts.validator.DynaValidatorForm">
>       ...
>       <form-property name="method" type="java.lang.String"/>
>       ...
> </form-bean>
> 
> The Form is populated by an Action:
> 
> public ActionForward execute(ActionMapping mapping, ActionForm form,
> HttpServletRequest request, HttpServletResponse response) {
>       DynaValidatorForm lvform = (DynaValidatorForm) form;
>       ...
>       lvform.set("method", "add");
>       ...
>       request.setAttribute(mapping.getAttribute(), lvform);
>       return mapping.findForward("continue");
> }
> 
> After this the Fields in the Form-JSP are filled correct.
> 
> Depending on what method I use I want to output different messages.
> 
> For this I tried to use these JSTL-Tags:
> 
> <c:choose>
>      <c:when test="${lvForm.map.method == 'update'}">
>          <h1><bean:message key="lvform.update"/></h1>
>      </c:when>
>      <c:when test="${lvForm.map.method == 'delete'}">
>          <h1><bean:message key="lvform.delete"/></h1>
>      </c:when>
>      <c:otherwise>
>          <h1><bean:message key="lvform.add"/></h1>    
>      </c:otherwise>   
> </c:choose>
> 
> But I allways run into the otherwise tree.
> 
> I also tries this without success:
> 
> <c:when test="${lvForm.map['method'] == 'update'}">
>     <h1><bean:message key="lvform.update"/></h1>
> </c:when>
> 
> So I hope that anybody can help me to solve this problem.
> 
> Kind Regards and thank you very much
> 
> Alexander Kirsch

-- 
Kris Schneider <mailto:[EMAIL PROTECTED]>
D.O.Tech       <http://www.dotech.com/>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to