- This topic has 4 replies, 2 voices, and was last updated 20 years, 7 months ago by
Riyad Kalla.
-
AuthorPosts
-
mbagaiMemberHello,
In 3.8.2 on OS X 10.3, I used the “New form bean, action and JSP” wizard. The JSP that is created uses an incorrect line break syntax. Line breaks are coded as “</br>” where they should be “<br/>”.
At least the validator caught it 🙂
/Morten
Riyad KallaMemberMorten what is the content of the generated page? I just tried the same thing and have no <br> elements in my page.
<%@ page language="java"%> <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean"%> <%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html"%> <html> <head> <title>JSP for logoffForm form</title> </head> <body> <html:form action="/logoff"> <html:submit/><html:cancel/> </html:form> </body> </html>
mbagaiMemberThis is what I got when I opened the auto-generated JSP:
<%@ page language="java"%> <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean"%> <%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html"%> <html> <head> <title>JSP for loginForm form</title> </head> <body> <html:form action="/login"> userName : <html:text property="userName"/><html:errors property="userName"/></br> userPassword : <html:text property="userPassword"/><html:errors property="userPassword"/></br> <html:submit/><html:cancel/> </html:form> </body> </html>
Maybe the reason you didn’t get any line breaks is because you only had one element?
Thanks,
Morten
Riyad KallaMemberYep that’s exactly it, I was able to reproduce this. Thanks!
Riyad KallaMemberIf you are interested in working around this manuall until its fixed in 3.8.3, you can edit the following file:
<myeclipse dir>\eclipse\plugins\com.genuitec.eclipse.cross.easystruts.eclipse_3.8.2\xslt\JspForm.xslAnd change its contents to this:
<?xml version="1.0" encoding="ISO-8859-1" ?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="text" /> <!-- jsp element --> <xsl:template match="bean"> <%@ page language="java"%> <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean"%> <%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html"%> <html> <head> <title>JSP for <xsl:value-of select="form-name"/> form</title> </head> <body> <html:form action="<xsl:value-of select="path"/>"><xsl:apply-templates select="attribute"> <xsl:sort select="name"/> </xsl:apply-templates> <html:submit/><html:cancel/> </html:form> </body> </html> </xsl:template> <!-- attribute element --> <xsl:template match="attribute"><xsl:text> </xsl:text><xsl:value-of select="label"/> : <html:<xsl:value-of select="tag"/> property="<xsl:value-of select="name"/>"/><html:errors property="<xsl:value-of select="name"/>"/><br/></xsl:template> </xsl:stylesheet>
That will use <br/> instead.
-
AuthorPosts