struts新手求高手指点
跪求:我在做一个用户注册界面的时候,让用户选择所在省份,从数据库中调用省名
用 <html:select/> 报错,请问怎么修改啊!
我的jsp:
<html:form action= "userRegister " method= "post " focus= "username ">
<table border= "0 ">
<tr>
<td> 用户名 </td>
<td> <html:text property= "username " /> <html:button onclick= "checkusername() "> 检测用户名 </html:button> </td>
<td> 请输入用户名 <br/> <html:errors property= "regnamenull "/> </td>
</tr>
<tr>
<td> 密码 </td>
<td> <html:password property= "password " /> </td>
<td> 请输入密码 <br/> <html:errors property= "regpwdnull "/> </td>
</tr>
<tr>
<td> 请重新输入密码 </td>
<td> <html:password property= "repassword " /> </td>
<td> 请重新输入密码 <br/> <html:errors property= "regrepwdnull "/> </td>
</tr>
<tr>
<td> 真实姓名 </td>
<td> <html:text property= "realname "> </html:text> </td>
<td> 请输入真实姓名 </td>
</tr>
<tr> <td> 性别 </td>
<td> 男 <html:radio property= "male " name= "sex "/> 女 <html:radio property= "female " name= "sex "/> </td>
<td> 你的性别 </td>
</tr>
<tr>
<td> 密码找回问题 </td>
<td> <html:text property= "userquestion " /> </td>
<td> 请输入密码找回问题,你丢失密码后找回密码必用,请牢记! </td>
</tr>
<tr>
<td> 密码找回答案 </td>
<td> <html:text property= "useranswer " /> </td>
<td> 请输入密码找回答案,你丢失密码后找回密码必用,请牢记! </td>
</tr>
<tr>
<td> 所在省 </td>
<td> <html:select property= "province ">
<logic:iterate name= "province " property= "province ">
<html:option value= " <bean:write name= "province " property= "provincename "/> "> <bean:write name= "province " property= "provincename "/> </html:option>
</logic:iterate>
</html:select> </td>
<td> 请选择你所在的省份 </td>
</tr>
<tr>
<td> 所在市 </td>
<td> <html:text property= "city " /> </td>
<td> 请填写你所在的城市 </td>
</tr>
<tr>
<td> 电子邮箱 </td>
<td> <html:text property= "email " /> </td>
<td> 请填写你的电子邮箱,如有变化请及时更改 </td>
</tr>
<tr>
<td> 联系电话 </td>
<td> <html:text property= "telephone " /> </td>
<td> 请填写你的联系电话,如有变化请及时更改 </td>
</tr>
<tr>
<td> 区号 </td>
<td> <html:text property= "zip " /> </td>
<td> 请填写你所在地区的区号 </td>
</tr>
<tr>
<td> 详细地址 </td>
<td> <html:text property= "address " /> </td>
<td> 请填写你的详细地址 </td>
</tr>
<tr>
<td align= "center " colspan= "2 "> <html:submit> 提交 </html:submit> </td>
</tr>
</table>
</html:form>
</body>
报的错误:
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: /user/userRegister.jsp(160,59) equal symbol expected
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:512)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
org.apache.jasper.JasperException: /user/userRegister.jsp(160,59) equal symbol expected
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:405)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:86)
org.apache.jasper.compiler.Parser.parseAttribute(Parser.java:193)
org.apache.jasper.compiler.Parser.parseAttributes(Parser.java:143)
org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1338)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1577)
org.apache.jasper.compiler.Parser.parseBody(Parser.java:1806)
org.apache.jasper.compiler.Parser.parseOptionalBody(Parser.java:1069)
org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1377)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1577)
org.apache.jasper.compiler.Parser.parseBody(Parser.java:1806)
org.apache.jasper.compiler.Parser.parseOptionalBody(Parser.java:1069)
org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1377)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1577)
org.apache.jasper.compiler.Parser.parseBody(Parser.java:1806)
org.apache.jasper.compiler.Parser.parseOptionalBody(Parser.java:1069)
org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1377)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1577)
org.apache.jasper.compiler.Parser.parseBody(Parser.java:1806)
org.apache.jasper.compiler.Parser.parseOptionalBody(Parser.java:1069)
org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1377)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1577)
org.apache.jasper.compiler.Parser.parse(Parser.java:126)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:211)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:100)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:155)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:276)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:264)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:305)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.20 logs.
[解决办法]
<html:select property= "userCompany ">
<html:optionsCollection property= "companyMap " value= "key " label= "value "/>
</html:select>
将省份的code 和 name存在一个Hashmap里 ,分别对应Hashmap的key值和value值
[解决办法]
到 http://www.netyi.net/in.asp?id=y409505 去看看,上面有很多Struts这方面的资料下载,希望你可以找到!
我的异常网推荐解决方案:The server encountered an internal error () that prevented it from fulfilling this request.,http://www.myexception.cn/java-web/317.html