Iterative MAP on Struts2 in traverse

java code, respectively, in the map of types of data into the List

public String travelIndex() throws DataAccessException{
 OuteType outeType = new OuteType();
                List<OuteType> innerList = outeTypeService.list(outeType, 0, 1000);
                outeTypeMap.put(OuteType.FATHERNAME_C, innerList);

                List<OuteType> interList = outeTypeService.list(outeType, 0, 1000);
                outeTypeMap.put(OuteType.FATHERNAME_I, interList);
                return SUCCESS;

struts2 page code:

 <s:iterator value="outeTypeMap">
                        <s:set name="typeId" value="#column.key"></s:set>
                        <s:text name="%{typeId}"></s:text>
                        <s:if test='#typeId=="c"'>
                           <h2><a href="" target="_blank"> Domestic tourism  </a></h2>
                           <s:iterator value="#column.value" status="s">
                                <p><a href="" target="_blank"><s:property value="typeName"/></a><span>|</span></p>
                        <s:elseif test='#typeId=="i"'>
                           <h2><a href="" target="_blank"> International tourism  </a></h2>
                           <s:iterator value="#column.value" status="s">
                                <p><a href="" target="_blank"><s:property value="typeName"/></a><span>|</span></p>

In the page, need to compare map of the key, to achieve different data display.
In <s:if test='#typeId=="c"'> in the original, with <s:if test="#typeId=='c'"> does not work, you must use <s: if test = ' # typeId == "c" '> to be displayed.

分类:Web 时间:2010-08-12 人气:182
blog comments powered by Disqus


  • How to use the js code or Java code jsp tag 2011-05-05

    JSP tag is still very convenient, such as Struts, Spring and other JSP tags provided to us, you can use them to get some variable or calculation. For example struts2 of <s:url value="/admin/unmi.action"/> automatically for us in front of t

  • Java code optimization, strategies and methods 2010-05-04

    Java code optimization, strategies and methods - Summary 1. How to Use Exception Exception decrease performance. An exception thrown first need to create a new object. Throwable interface, the constructor call, called fillInStackTrace () local method

  • Test java code using 2010-04-16

    package java2html; import*; /** * Java To HTML code <code><p>5555555555</p></code> * * @author llliiiuuu * @since 2008-12-16 * @version 0.1a */ public class JavaToHTML { public static void main(String[] args) throws IOExce

  • java code for the page 2010-02-09

    Recent studies have crawled pages, and discovered to obtain the page's encoding format, Java implementations is not ready, although there are a csdn Daren wrote an article, with code, unfortunately, I did not find the relevant package, a last resort,

  • java code programming optimization 2010-03-26

    Procedures for the use of available resources (memory, CPU time, network bandwidth, etc.) is limited, the purpose of optimization is to allow programs to use the least resources to complete the scheduled tasks. Optimization usually contains two aspec

  • java Code Generation 2010-05-01

    1. Generated verification code: using technology jsp, servlet 2. Generated verification code in the servlet: package servlet; import java.awt.Color; import java.awt.Font; import java.awt.Graphics; import java.awt.image.BufferedImage; import

  • jsp page using java code 2010-05-28

    Previously, I do not like jsp pages directly to use java code block, mosaic java code, but after work, use this situation, I changed the mind, in fact, it has the convenience of his office ah! <%@ page language="java" import="java.util.*

  • java code Note 2010-06-03: StringTokenizer and the use of HashMap instance 2010-06-07

    -------- StringTokenizer and the use of HashMap instance ------------ import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.Set; import java.util.StringTokenizer; public class jay_x_stringtokenizer_map ( void sta

  • java Code Recognition - 1 Collection 2010-09-17

    (This article is only for study, research, image matching recognition principle, not be used for other purposes. Recently looked at the validation code recognition, starting with the easiest to start it (fixed size, fixed location, fixed font) Code i

  • JAVA code automatically discuz 7.2 post on the forum 2011-01-06

    Met a Powered by discuz 7.2! The Forum, integral constraints, very unhappy, and posted to increase the points, so I spent some time pondering getting a automatic posting machine, the following is the basic principle of the code and instructions to au

iOS 开发

Android 开发

Python 开发



PHP 开发

Ruby 开发






Javascript 开发

.NET 开发



Copyright (C), All Rights Reserved. 版权所有 闽ICP备15018612号

processed in 0.035 (s). 11 q(s)