struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Taner Diler <taner.di...@gmail.com>
Subject usage of ${...}
Date Tue, 15 Jan 2013 16:17:31 GMT
Hi,

I'm beginner on struts 2. I want to display object properties by using
${...} in s:iterator tag. But It's not being rendered and ${name}
displaying. Is there any configuration that I missed?

*list.jsp*

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head></head>
<body>
<h1>User List</h1>

<ul class="nav nav-list todo-list">
    <s:iterator value="#request.users" var="user">
        <li id="user-<s:property value="#user.id"/>-${id}">
            <span id="user-<s:property value="#user.id"/>-fullname"><s:property
value="fullname"/>**</span>
            <span id="user-<s:property value="#user.id"/>-email"><s:property
value="email"/></span>
            <s:if test="roles.length != 0">
                <s:iterator value="roles" var="role">
                <span id="user-<s:property value="#user.id"/>-role-<s:property
value="#role.id"/>" class="todo-category badge badge-info">
                    <s:property value="name"/>
                </span>
                </s:iterator>
            </s:if>
        </li>
    </s:iterator>
</ul>

</body>
</html>


struts.xml

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">

<struts>
     <constant name="struts.devMode" value="true" />

    <constant name="struts.i18n.reload" value="true"/>

    <package name="default" namespace="/" extends="struts-default">

        <interceptors>

            <interceptor name="login"
                class="ui.user.actions.LoginInterceptor"></interceptor>

            <interceptor name="auth"

class="ui.user.actions.AuthorizationInterceptor"></interceptor>

            <interceptor-stack name="securestack">
                   <interceptor-ref name="login"/>
                   <interceptor-ref name="auth"/>
                <interceptor-ref name="defaultStack" />
            </interceptor-stack>
            <interceptor-stack name="unsecurestack">
                <interceptor-ref name="defaultStack" />
            </interceptor-stack>
        </interceptors>
    </package>
</struts>


*maven dependencies *

    <dependencies>
        <dependency>
            <groupId>com.google.collections</groupId>
            <artifactId>google-collections</artifactId>
            <version>1.0</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.0.1</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>javax.servlet.jsp</groupId>
            <artifactId>javax.servlet.jsp-api</artifactId>
            <version>2.2.1</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>javax.el</groupId>
            <artifactId>javax.el-api</artifactId>
            <version>2.2.2</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.5</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.struts</groupId>
            <artifactId>struts2-core</artifactId>
            <version>2.3.8</version>
        </dependency>

        <dependency>
            <groupId>com.jgeppert.struts2.jquery</groupId>
            <artifactId>struts2-jquery-plugin</artifactId>
            <version>3.5.0</version>
        </dependency>

        <dependency>
            <groupId>org.apache.struts</groupId>
            <artifactId>struts2-convention-plugin</artifactId>
            <version>2.3.8</version>
        </dependency>

    </dependencies>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message