I'm still on tc4.1 so i need the el tags but I have this working.

<put name="action" value="/Logon.do" type="string" />

<tiles:useAttribute name="action" />

<html-el:form action="${action}">

On 30 Mar 2004, at 15:51, Dean A. Hoover wrote:

Thanks for the help, but this is still throwing an exception. I am using tomcat 5
and this is what I did. I grabbed all of the contrib/lib stuff for struts-el. Made
web.xml aware of bean-el, html-el and c. Have the following in tiles-defs.xml:
<put name="action" value="/Logon.do"/>


Have the following in the JSP file:
<%@ taglib uri="/tags/struts-html-el" prefix="html" %>
...
<tiles:importAttribute/>
<html:form method="post" action="${pageContext.action}">

When I run it, this is what happens in the log:
2004-03-30 08:39:03 DEBUG InsertTag.java:945 - [ServletException in:/WEB-INF/til
es/layouts/FormLayout.jsp] An error occurred while evaluating custom action attr
ibute "action" with value "${pageContext.action}": Unable to find a value for "a
ction" in object of class "org.apache.jasper.runtime.PageContextImpl" using oper
ator "." (null)'


Did I miss something here?
Dean Hoover

Avinash Gangadharan wrote:

Dean,
        By default, the <tiles:importAttribute> tag imports all of the Tiles
context         attributes into the page context:<tiles:importAttribute/>
        Any and all attributes stored in the current Tiles context would now
be available    through the standard page context.

The situation with your jsp is that we gotto get the "action" from the
pageContext into your html:form tag. JSTL can help us in it provided you use
the html-el tags which will support expressions. So may be this can help
you.


<tiles:importAttribute /> <html-el:form method="post" action="${pageContext.action}">

Or at the worst with simple html:form tags:

<tiles:importAttribute /> <%String act = pageContext.getAttribute("action")%>
<%-- the code below will dump your action. Just to make sure .
Remove it later--%>
<%=out.println( pageContext.getAttribute("action") ) %>
<html:form method="post" action="<%=act%>">


The second one would surely work, but it may better using tags instead.


Hope this solves the problem.


Avinash






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



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



Reply via email to