Home > Back-end >  Beginners are less likely to be, what's the problem
Beginners are less likely to be, what's the problem

Time:10-03


<% @ page language="Java" import="Java. Util. *" pageEncoding="utf-8" % & gt;
<% @ page import="Java. Util. ArrayList" % & gt;
<% @ page import="WHX. Entity. *;" % & gt;

<body>
<% ArrayList liuyanlist=(ArrayList) application. The getAttribute (" liuyanlist "); % & gt;
<% for (int I=liuyanlist. The size () - 1; I>=0; I -) {% & gt;
<% LiuYanInfo lyi=(LiuYanInfo) liuyanlist. Get (I); % & gt;
Title: & lt; %=lyi. The getTitle () % & gt;

Author: & lt; %=lyi. The getName () % & gt;

Content: & lt; %=lyi. The getContent () % & gt;

Time: & lt; %=lyi. GetTime () % & gt;

<% out. The print (" * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * "); % & gt;

<%} % & gt;

CodePudding user response:

Can use a forEach tag
 




Name & lt;/th> Description & lt;/th> Preview picture & lt;/th>
The ${item. AdvertName} & lt;/td> The ${item. Notes} & lt;/td>



Or

<%
ArrayList liuyanlist=(ArrayList) application. The getAttribute (" liuyanlist ");
For (int I=liuyanlist. The size () - 1; I>=0; I -) {
LiuYanInfo lyi=(LiuYanInfo) liuyanlist. Get (I);
Out. Print (lyi. GetTitle ());
Or out. Print (lyi. GetTitle () + "& lt; Br>" );//should be behind this kind of
.
.
Out. Print (" * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ");
//the br can't output on print to print inside the
} % & gt;

CodePudding user response:

Long time didn't write the JSP, don't forget

CodePudding user response:



A kind of very old, new, learn,
  • Related