How to check if an iterator is empty inside a s:subset?

2009-11-19 Thread Cristian Peraferrer
Hi,

I'm trying to show a There are no items in the list message in my
application. I'm using a subset the following way:

s:subset source=myList decider=myDecider var=myListIterator
s:if test=#myListIterator.hasNext()
s:iterator status=status
  tr class=s:if test=#status.eveneven/s:ifs:elseodd/s:else
tds:property value=%{name}//td
tds:property value=%{type}//td
  /tr
/s:iterator
/s:if
s:else
tr
  td colspan=2There are no items in the list/td
/tr
/s:else
  /s:subset

But I'm not able to find how to access to the subset iterator... to
check if the iterator (or the subset list) is empty.

I'd appreciate any help.

Thanks,
Cris

-- 
GPG Key-ID: 0x564903FA - JID: corell...@swissjabber.ch

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Setting Session setMaxInactiveInterval

2009-11-19 Thread CRANFORD, CHRIS

What is the proper way in Struts2 to dynamically set a particular
application's session timeout value (HttpSession setMaxInactiveInterval)
during the login process so that the session properly expires?  

Is this only possible by creating an HttpSessionListener and putting it
in web.xml?

public class MyAppSessionListener implements HttpSessionListener 
{
  public void sessionCreated(HttpSessionEvent event) {
HttpSession session = event.getSession();
session.setMaxInactiveInterval(60*5);
  }
  public void sessionDestroyed(HttpSessionEvent event) {
HttpSession session = event.getSession();
Session.invalidate();
  }
}

listener
  listener-classMyAppSessionListener/listener-class
/listener

Thanks,
Chris



-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Question about struts templates

2009-11-19 Thread Oscar
Hi to all, i have a problem with struts 2 templates. The problem is that 
when i put a s:submit in my jsp for example, it automatically creates a 
div containing the submit and a new column in the table, and i don't 
want that, i only want only the button. Is there a way to tell struts 
that i don' want to use any template?


Thanks in advance

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Question about struts templates

2009-11-19 Thread Burton Rhodes
Use the 'simple' theme. It just prints the HTML tag.

On 11/19/09, Oscar oscar.kalde...@gmail.com wrote:
 Hi to all, i have a problem with struts 2 templates. The problem is that
 when i put a s:submit in my jsp for example, it automatically creates a
 div containing the submit and a new column in the table, and i don't
 want that, i only want only the button. Is there a way to tell struts
 that i don' want to use any template?

 Thanks in advance

 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org



-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Question about struts templates

2009-11-19 Thread Oscar
Thanks for your answer Burton. I didn't know how to do that but for 
others that could have that problem to the way to do this is the next:


Declare a constant in struts.xml like this:

constant name=struts.ui.theme value=simple /

Burton Rhodes escribió:

Use the 'simple' theme. It just prints the HTML tag.

On 11/19/09, Oscar oscar.kalde...@gmail.com wrote:
  

Hi to all, i have a problem with struts 2 templates. The problem is that
when i put a s:submit in my jsp for example, it automatically creates a
div containing the submit and a new column in the table, and i don't
want that, i only want only the button. Is there a way to tell struts
that i don' want to use any template?

Thanks in advance

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org





-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org


  


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Strange behavior after upgrade

2009-11-19 Thread Thomas Sattler
Hello all.

I have upgraded a Struts 2.0.11 project to 2.1.8, and I have some strange
behavior.  The Struts stuff seems to work fine, and the Ajax stuff works
fine as well.  The Hibernate stuff works as far as reading data is
concerned.  But when I try to write a record, nothing happens on the
database and I get no exception thrown, and I get no errors in the log.

For instance, whenever a user logs in, a LoginHistory object is created, and
subsequently written to the login_history table in Postgres.  The
application is using the EntityManager to persist a new object.  The code is
simple; the LoginHistoryService class says:


public void persist(LoginHistory loginHistory)
{try {
System.out.println(About to insert login_history record) ;
entityManager.persist(loginHistory);
System.out.println(Done inserting login_history record) ;
}
catch (Exception ex)
{
System.out.println(ex.getMessage() ) ;
}
}

I see the two logged messages, and in stepping through with a debugger, the
persist statement *seems* to be done, but nothing appears in the database.

Also, when changing a User's account data, nothing winds up in Postgres.
The UserService class says:


public void merge(User user)
{   try {
entityManager.merge(user);
}
catch (Exception ex)
{
System.out.println(ex.getMessage() ) ;
}
}

But the record is never changed.


The Hibernate section of pom.xml says:

dependency
 groupIdorg.hibernate/groupId
 artifactIdhibernate/artifactId
version3.2.1.ga/version
/dependency

dependency
 groupIdorg.hibernate/groupId
 artifactIdhibernate-annotations/artifactId
 version3.2.1.ga/version
/dependency

dependency
 groupIdorg.hibernate/groupId
 artifactIdhibernate-entitymanager/artifactId
 version3.2.1.ga/version
/dependency


As I sit here pulling my hair out, does anyone remember having anything like
this happen after an upgrade to 2.1.8?  Or an any other circumstance?

Thanks,
Tom