页面提交后保留原有数据

可以用el表达式来做到,
比如<input type=”text” name=”username” />这个输入框中,
想在表单提交后保留输入的值,直接改为这样即可:
<input type=”text” name=”username”
或者在jsp中加上value=<%= somebean.getAttribute()%>
若是在提交到同一页面,需要给somebean的attribute赋 “” 的初值,否则会显示null。

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s