JSP (12)--form Edit

Source: Internet
Author: User
JS For example from the Blazix server's logo library in your system environment can not be used, then do not use the logo library to achieve similar functions? This tutorial is proposed for this issue. This problem can be solved, but the code should be a little longer. Basically, you have to edit the HTML logo yourself, and then set it to the default value. From the example below we can learn how to modify getname.jsp to provide features similar to Blx:getproperty, but we can only edit HTML flags manually:

<jsp:useBean id="user" class="UserData" scope="session"/>
<HTML>
<BODY>
<FORM METHOD=POST ACTION="SaveName.jsp">
What's your name? <INPUT TYPE=TEXT NAME=username
SIZE=20 VALUE="<%= user.getUsername() %>"><BR>
What's your e-mail address? <INPUT TYPE=TEXT
NAME=email SIZE=20
VALUE="<%= user.getEmail() %>"><BR>
What's your age? <INPUT TYPE=TEXT NAME=age
SIZE=4 VALUE=<%= user.getAge() %>>
<P><INPUT TYPE=SUBMIT>
</FORM>
</BODY>
</HTML> 
As the preceding code shows, it simply adds a "VALUE" area to the input flag and initializes the area with an expression.
To handle the exception error in the input process, we can use the "String" area in the bean and convert it to the target data type. So you can also handle exception errors.
As a after-school exercise, we can change the example in the previous tutorial to a Blazix logo library.
At this point, this "JSP from the Light" series of tutorials to the end, I hope to help you.


Related Article

Alibaba Cloud 10 Year Anniversary

With You, We are Shaping a Digital World, 2009-2019

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.