<jsp:getProperty 乱码
<jsp:getProperty 乱码
从一个html 传给一个jsp 内容(没用控制层 直接传)
数字 英文都正常 传中文就乱码
html页写了 <meta http-equiv="content-type" content="text/html; charset=gbk">
jsp页也有 pageEncoding="gbk"
还加了 request.setCharacterEncoding("gbk");
不行。。。 显示的还是乱码
请教各位了...
你是用表单传的吗?表单的方法是用的get还是post?
建议用post方法试试
另外,加上这行代码再试试
response.setContentType("text/html;charset=gbk");
建议你发代码出来 大家比较好研究一点
这样还有问题,学习中。。
request.setCharacterEncoding("gbk");
表单要以post方式提交才有效。
就是post提交的。。
html
HTML code:
<form action="doOrder.jsp" method="post">
<table>
<tr>
<td>姓名:<input type="text" name="name"></td>
</tr>
<tr>
<td>邮编:<input type="text" name="post"></td>
</tr>
<tr>
<td>电话:<input type="text" name="tel"></td>
</tr>
<tr>
<td>卡号:<input type="text" name="cardNumber"><
相关问答:
我现在想用ssh整合来做一个论坛,但数据库方面不行,我主要不会涉及数据库,不知道发帖表,和回帖表要如何设计和区分。不知道谁有一个简单的思路,来设计这些表。谢谢了。
发帖和回帖用同一张表 。发帖 id user ......
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jas ......
我的程序如下:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv=&q ......
问题描述:
例如我要显示的内容如下所示
一级目录1
一级目录1子类1
子类1
一级目录1子类2
......
新手:
tomcat+struts 2.0
jsp 页面直接关联model
现在需要根据model(admin)里面的一个item(id),判断jsp页面出现的内容.
大概流程:
...
<table>
<tr>
<td>
<s:if admin.id is null> ......