使用<s:iterator/>标签在页面读取list中信息
一:action中:
private FunctionalityService functionalityService;
private List<String> actionNameList = null;
public List<String> getActionNameList() {
return actionNameList;
}
public void setActionNameList(List<String> actionNameList) {
this.actionNameList = actionNameList;
}
public void setFunctionalityService(FunctionalityService functionalityService) {
this.functionalityService = functionalityService;
}
public String tostatisticsLogs(){
HttpServletRequest request = ServletActionContext.getRequest();
actionNameList = functionalityService.queryAllActionName();
request.setAttribute("actionNameList", actionNameList);
return "to_access_statistics_success";
}
二:页面上:
<select name="actionSelector" id="dataTypeID" style="width: 270px">
<s:iterator value="#request.actionNameList">
<option value="<s:property/>">
<s:property />
</option>
</s:iterator>
</select>
三:最底层的方法
public List<String> queryAllActionName(){
String queryString =
new StringBuilder("select m.action from ").append(instanceclass.getName()).
append(" as m group by m.action").toString();
System.out.println("当前的sql语句是:queryString = "+queryString);
return (List<String>)getHibernateTemplate().find(queryString);
}
相关推荐
<s:param name="id"><s:property value="id"/></s:param> </s:url>">Edit</a> </td> <td> <a href="<s:url action="delete" portletMode="edit"> <s:param name="id"><s:...
taskInstanceId=<s:property value="id"/>" >我来处理</a>)</s:if> <s:elseif test='{#taskName == "受评对象准备评级资料"}'> <a href="${pageContext.request.contextPath}/ga/needModify.action?...
3. <s:action name=""></s:action>-----执行一个view里面的一个action 4. <s:actionerror/>-----如果action的errors有值那么显示出来 5. <s:actionmessage/>-----如果action的message有值那么显示出来 6. <s:...
<property name="username" value="root"> </property> <property name="password" value="tarena"> </property> <property name="url" value="jdbc:mysql://localhost:3306/test"> </property> ...
<form name="form1" action="login.do" method="post"> <table width="300" border="1"> <tr> <td colspan="2"><bean:message key="login.page.title" /></td> </tr> <tr> <td><bean:message key="login.page...
<property name="transactionManager" ref="transactionManager" /> <property name="transactionAttributes"> <!-- 下面定义事务传播属性 [ bus* 事务的方法名]--> <props> <prop key="bus*">...
<br/> </th><br/> <td align="left"><br/> <html:text property="logname" size="20" maxlength="20"/><br/> </td><br/> </tr><br/> <tr><br/> <th align="right"><br/> Password:<br/> </th><br/> <td align="left...
三大框架分页的实现: DAO里写法: //查出页面要显示的字段 -----... <property name="newsclassService"> //这个名字要和action里定义的那个成员变量对应 <ref bean="newsclassService"/> </property> </bean>
<bean:write name="td" property="value"/></logic:notEqual> <logic:equal name="td" property="value" value=""> </logic:equal> </td> </logic:iterate> </tr> </html:link> </logic:iterate>
<td><bean:write name="temp" property="trade"/></td> <td><bean:write name="temp" property="sex"/></td> </tr> </logic:iterate> </logic:present> <tr> <td colspan="4" ...
<h2>您最喜爱的奥斯卡获奖影片是:</h2> <table border bordercolor="#0066FF" bgcolor="#CCFFFF"> <form method="post" action="vote.jsp"> <% ResultSet rs=db.executeQuery("select * from vote"); while(rs....
--将action内容放在package元素下,package元素的name值与extends值可以使用默认值,如下所示 --> <package name="abstract_struts" abstract="true" extends="struts-default" namespace="/"> <interceptors> ...
<property name="viewClass" value="org.springframework.web.servlet.view.JstlView" /> <property name="prefix" value="/jsp/" /> <property name="suffix" value=".jsp" /> </bean> <!-- 配置jdbc -...
DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><br><html><br> <head><br> </head><br> <body><br> <table><br> <tr><br> <td><%@ include file="../menu.txt"%><br> </td><br> </tr>...
说明:<br>一、含演示数据库建立脚本(较简单)<br>二、使用Struts、Hibernate和display超简单的实现了分页,你不用在页面上再写很多<%%>和很多判断,简单到只需要几行语句:<br>...table name="lst" cellspacing="0" ...
void ActivationEventBeginInvoke(Func<int> id,Action<IEnumerable<T>> TValue = null, Action<IAsyncResult> Ting=null); IEnumerable<T> GetChildList(); void GetChildList(Action<IEnumerable<T>> TValue)...
<jsp:setProperty name="query" property="*"/> </jsp:useBean> <html> <body> <% request.setCharacterEncoding("UTF-8"); String name=request.getParameter("username"); String password=request....
login"><div class="hand"></div><div class="hand hand-r"></div><div class="arms"><div class="arm"></div><div class="arm arm-r"></div></div></div><div class="pad"><input type="hidden" name="_csrf" value...
<property name="OrderNumber"/> <property name="OrderDate"/> <many-to-one name="Customer" /> <set name="OrderLines" cascade="all-delete-orphan" > <key column="OrderId"/> <one-to-many class=...
查询到如下记录:<BR> <% StringBuffer b=book.getMessageBybook_id(); %> <%=b%> <P>如果准备订购该书,请填写订单,点击"添加到订单"按钮<BR> <%if((book.getId())!=0) {%> <FORM action="<%=str%>" method=...