seam 中文乱码

jbossseam 版本为 2.1 web服务器为jboss 4.2;

 

在普通没有中文的情况下.点击一个查询一般的链接如下:

 

 

<div class="actionButtons" align="center">
	<h:commandButton id="search" value="搜索" action="/transAccounts/TemporaryAccountList.xhtml" styleClass="tools_button" />

</div>

 

  如果其中有中文参数:

 

 

	<param name="mobile" value="#{temporaryAccountList.mobile}" />
	<param name="idcard" value="#{temporaryAccountList.idcard}" />
	<param name="accounttype" value="#{temporaryAccountList.accounttype}" />
	<param name="realname" value="#{temporaryAccountList.realname}" />//realname 为用户姓名
	<param name="status" value="#{temporaryAccountList.status}" />

  其中realname 为中文..在点击查询时对应的ejb的类中

private String realname;  这里属性的值就会变成乱码..

 

 

 这里就需要把上面的那个查询按钮的action属性改成实际的方法..即可解决问题;如下:

 

 

<div class="actionButtons" align="center">
	<h:commandButton id="search" value="搜索" action="#{temporaryAccountList.doResult()}" styleClass="tools_button" />
</div> 

 

对应ejb中添加doResult()方法如下:

其中getResultList 才是实际获取数据集合的方法..

 

 

public void doResult(){
		queryFlag = true;
	}
	
	@Restrict("#{permissionChecker.hasPermission('temporaryaccount', 'query')}")
	public List<AccountPrizeTransMapping> getResultList(){
		if(queryFlag){
			return super.getResultList();
		}
		return null;
	}

 

其实解决这个问题的最好方法是修改在jboss内嵌的tomcat 里的server.xml

  <Connector port="8080" 这里添加 URIEncoding="UTF-8"

介绍CMS开发的外文PDF格式的书 What this book is about This book assumes a software designer’s perspective and presents a collection of patterns that address the content-related aspects of custom software development for advanced websites or web platforms. So what are patterns? Patterns represent good practice and suggest solutions that have worked well in many practical cases. Mined from a series of successful web projects, the patterns in this book represent the collected expertise of designers from several software development teams. Key topics in the book include content modelling and content organisation, navigation, findability, personalisation and user participation. The patterns are independent of specific tools and technologies. They focus on non-functional requirements, with the overall goal of defining a sustainable software architecture. In addition, checklists for managing a web project and for the selection of a web content management system give practical and straightforward advice. I am not going to present one specific architecture, though. The reason for this is simple enough: websites are much too heterogeneous to be designed in a uniform way. Requirements differ a lot, as do the underlying technologies. There is no point in trying to define a single all-purpose architecture. Instead, the patterns in this book should serve as a practical guide to designing your own content-related custom components for your web project. Since the patterns are independent of any specific tool or programming language, you can use them to define an architecture that matches your specific needs. This isn’t to say that you have to develop all software components yourself. Actually, you should not do so. First, you’ll probably be using a content management system. There are many systems available on the market, so it is unlikely you will have to develop your own. Second, you will probably be using frameworks for web development, such as Struts, Java Server Faces, Ruby on Rails or something else. These tools can save you a lot of work, but you will have to integrate them, and there is no question that a non-trivial site with individual requirements will also require a good deal of custom software. This is where this book can help you. The book is also meant to help you to define a sustainable architecture – one that has a lasting positive effect on your website’s system characteristics. The patterns not only seek to align code and content, but also focus on non-functional requirements. For example, the site should be fast, despite the fact that good response times can be hard to achieve, especially in the presence of personalisation. Next, maintainability is essential. Only a solid architecture can ensure that later changes to your site won’t require a large and unjustified effort. There are also other important non-functional requirements, including security, reliability and scalability. Since the patterns in this book keep an eye on these things, they can help you to design a website with an underlying high-quality software architecture.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值