CERNET research 3 Use of displytag

Source: Internet
Author: User

Displytag Chinese garbled characters in CERNET

All. jsp
<JSP: Root version = "1.2" xmlns: JSP = "http://java.sun.com/JSP/Page" xmlns: Display = "urn: jsptld: http://displaytag.sf.net"
Xmlns: c = "urn: jsptld: http://java.sun.com/jstl/core">

<JSP: Directive. Page import = "Java. util. *, Com. pp. DB. *"/>
<JSP: Directive. Page contenttype = "text/html; charsets = UTF-8"/>
<JSP: Directive. Page import = "My. Bean. *"/>
<Head> <title> my tags </title> <JSP: Include page = "INC/header. jsp" Flush = "true"/>
<JSP: scriptlet>

Source_inf INF1 = new source_inf ();
Dboperate DBO = new dboperate ();
String hql = "from source_inf ";
List list = DBO. findall (hql );
Request. setattribute ("test", list );

</Jsp: scriptlet>
<Display: Table name = "test" defaultsort = "1" defaultorder = "ASCENDING" class = "simple" pagesize = "5">
<Display: caption> question download list </display: caption>
<Display: column property = "ID" Title = "Serial Number" href = "tvdetails. JSP "paramid =" ID "sortable =" true "headerclass =" sortable "> </display: column>
<Display: column property = "FILENAME" Title = "file name" sortable = "true" headerclass = "sortable"> </display: column>
<Display: Column Title = "email" autolink = "true" maxlength = "20" class = "textred"> email@it.com </display: column>
<Display: footer>
<Tr>
<TD colspan = "4"> sample footer </TD>

</Tr>
</Display: footer>

</Display: Table>

</Jsp: root>

Dboperation. Java
Public list findall (string hql ){
List list = NULL;
Try {
Conn = dbconnection. getconnection ();
Sessionfactory = This. getsessionfactory ();
If (sessionfactory! = NULL ){
Session = sessionfactory. opensession (conn );
Transaction = session. begintransaction ();
List = session. createquery (hql). List ();
}
}
Catch (exception e ){
Log. Error (pubfunc. getnow () + "hibernate get the list! "+ E. getmessage ());
E. printstacktrace ();
}
Finally {
Close (session );
Dbconnection. closeconnection (conn );
}
Return list;

}

 

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.