Re: Checkboxes problem

2007-07-04 Thread Andreja

Sharad, thank you for the answer.

Keeping in mind what you said, I tried to make it work like this:

 
 
  
  
 

This populates the checkboxes, but when I submit the data, all I can
get is ArrayList of true booleans: [true, true...], and I can not use
that. I need something like:

[x]Tom
[ ]Dick
[x]Harry

And after submit, the list should be: [Tom, Harry].
The problem is that I can not make checkbox return String value
instead of boolean. There must be a way to do so, because
s:checkboxlist can return ArrayList, but I don't know how to
do so by using s:checkbox.

Regards,
Andreja

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[S2] datepicker default value in 2.1

2007-07-04 Thread nodep

Hi, I don't know if I can post here a question about version 2.1 but ... I do
:)
I have downloaded and  compiled (from svn) the version 2.1 of Struts2. My
question is: is it possible 
to set the default value of a datepicker field so that when i make a mistake
filling the field it don't change
the value to 01/01/1970? 
For example, when I write "22/04/2007u" then the value is changed to
"01/01/1970", but I would like to 
leave the wrong value and to validate it at the submit of the post (like YUI
^_^ ).


Stefano

-- 
View this message in context: 
http://www.nabble.com/-S2--datepicker-default-value-in-2.1-tf4023311.html#a11427530
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Checkboxes problem

2007-07-04 Thread sharad bhushan

or

  
   
   
  

Any of this should solve your problem. first one will iterate for itself second 
we are doing that.
But still all checkbox shouldhave same name. You bean of will surely get list 
of values(not true).

- Original Message 
From: Andreja <[EMAIL PROTECTED]>
To: Struts Users Mailing List 
Sent: Wednesday, 4 July, 2007 1:24:25 PM
Subject: Re: Checkboxes problem

Sharad, thank you for the answer.

Keeping in mind what you said, I tried to make it work like this:

  
  
   
   
  

This populates the checkboxes, but when I submit the data, all I can
get is ArrayList of true booleans: [true, true...], and I can not use
that. I need something like:

[x]Tom
[ ]Dick
[x]Harry

And after submit, the list should be: [Tom, Harry].
The problem is that I can not make checkbox return String value
instead of boolean. There must be a way to do so, because
s:checkboxlist can return ArrayList, but I don't know how to
do so by using s:checkbox.

Regards,
Andreja

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]







Send free SMS to your Friends on Mobile from your Yahoo! Messenger. Download 
Now! http://messenger.yahoo.com/download.php

Re: Checkboxes problem

2007-07-04 Thread Andreja

Thank you very much Sharad, that WORKS! :]



Just for the archive, this is also a possibility:






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Populate s:select using Hasttable

2007-07-04 Thread Richard Sayre

I am trying to populate a s:select using a Hashtable.






<% customer.getCustomersForUser(sessionObject.getUserName()); %>



   




The customer.getCustomersForUser() method populates a Hashtable called
customerList which has the appropiate get and set.

I assumed that calling customer.customerList in the 'list' attribute
would call the customer.getCustomerList which would return the
Hashtable.

When I try to execute the code I get the following error:

org.apache.jasper.JasperException: tag 'select', field 'list': The
requested list key 'customer.customerList' could not be resolved as a
collection/array/map/enumeration/iterator type. Example: people or
people.{name} - [unknown location]
org.apache.struts2.components.Component.fieldError(Component.java:231)
org.apache.struts2.components.Component.findValue(Component.java:293)

org.apache.struts2.components.ListUIBean.evaluateExtraParams(ListUIBean.java:79)

.
.
.

I verified that the Hashtable is getting populated with data.  Is
there anything I am missing that needs to tell the select that I am
using a Hashtable?

Thank you,

Rich

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



How to change colors to an item of a select tag list

2007-07-04 Thread TonyD

I'am using struct 2.0.6. 
I need to populate a select tag list with different colors for each item
according to some conditions.   

example: 

First Item (in BLACK) 
Second Item (in GREEN) 
Third Item(in GREEN) 
Fourth Item  (in RED) 

Is it possible?  I haven't seen something like that in the structs showcase
example. 
Could someone help me please! Thanks! 

-- 
View this message in context: 
http://www.nabble.com/How-to-change-colors-to-an-item-of-a-select-tag-list-tf4024337.html#a11430650
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[struts 2] Problem in param setting

2007-07-04 Thread Filippo De Luca

Hello Struts users,
I am new for the struts 2 and i have some problem with param setting. I
develop a simple action to view user detail: UserViewAction this action have
only a execute method, loading a user by userId param. So the action work
fine, but the jsp page do not display anything.

Follow my code:

package it.filosganga.sic.business;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;
import java.util.*;

import org.apache.commons.lang.builder.*;
import
org.springmodules.validation.bean.conf.loader.annotation.handler.NotBlank;
import
org.springmodules.validation.bean.conf.loader.annotation.handler.NotNull;

/**
* Classe che rappresenta un utente del sistema
*
* @author Filippo De Luca
* @version 0.2.00, 1/05/2006
*/
public class User implements Serializable {

   /** serial */
   private static final long serialVersionUID = 200L;

   private Long id;

   private Long version;

   @NotNull
   @NotBlank
   private String username;

   @NotNull
   @NotBlank
   private String password;

   @NotNull
   private boolean enabled;

   @NotNull
   private Date expire;

   @NotNull
   private Date credentialsExpire;

   private Set authorities = new HashSet();

   private final PropertyChangeSupport pcs = new
PropertyChangeSupport(this);

   public User() {
   /* Empty */
   }

   ...
}

***

public class UserViewAction {
   /** serial */
   private static final long serialVersionUID = 1L;

   private static final Log log = LogFactory.getLog(UserViewAction.class);

   private UserService userService;

   private Long userId;
   private User user;

   /**
* @return the userService
*/
   public UserService getUserService() {
   return userService;
   }

   /**
* @param userService
*the userService to set
*/
   public void setUserService(UserService userService) {
   this.userService = userService;
   }

   /**
* @return the id
*/
   public Long getUserId() {
   return userId;
   }

   /**
* @param id
*the id to set
*/
   public void setUserId(Long id) {
   this.userId = id;
   log.debug("Setted id = " + id);
   }

   public String execute() {
   user = userService.findUserById(userId);

   log.debug("Loaded User = " + user);

   return "success";
   }

}

***

<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>


User - view




User:
Username:

Roles:

- 





***

   

   

   
   /User/list.jsp
   

   
   /User/view.jsp
   
   

Some code are omitted for easy read. Can anyone help me?

in the past i develop a PreparableAction loading user in prepare method, but
i need to use paramsPrepareParamsStack to run it. What is the best way? load
user in execute method or in prepare method?

Best regards

--
Filippo De Luca
[EMAIL PROTECTED]
http://www.filosganga.it
--
Circolo Canottieri Roma
Lungotevere Flaminio, 39 - 00196 - Roma - Italia
http://www.canottieriroma.com
--


Re: [struts 2] Problem in param setting

2007-07-04 Thread Filippo De Luca

2007/7/4, Filippo De Luca <[EMAIL PROTECTED]>:


Hello Struts users,
I am new for the struts 2 and i have some problem with param setting. I
develop a simple action to view user detail: UserViewAction this action have
only a execute method, loading a user by userId param. So the action work
fine, but the jsp page do not display anything.

Follow my code:

package it.filosganga.sic.business;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;
import java.util.*;

import org.apache.commons.lang.builder.*;
import
org.springmodules.validation.bean.conf.loader.annotation.handler.NotBlank;
import
org.springmodules.validation.bean.conf.loader.annotation.handler.NotNull;

/**
 * Classe che rappresenta un utente del sistema
 *
 * @author Filippo De Luca
 * @version 0.2.00, 1/05/2006
 */
public class User implements Serializable {

/** serial */
private static final long serialVersionUID = 200L;

private Long id;

private Long version;

@NotNull
@NotBlank
private String username;

@NotNull
@NotBlank
private String password;

@NotNull
private boolean enabled;

@NotNull
private Date expire;

@NotNull
private Date credentialsExpire;

private Set authorities = new HashSet();

private final PropertyChangeSupport pcs = new
PropertyChangeSupport(this);

public User() {
/* Empty */
}

...
}

***

public class UserViewAction {
/** serial */
private static final long serialVersionUID = 1L;

private static final Log log = LogFactory.getLog(UserViewAction.class
);

private UserService userService;

private Long userId;
private User user;

/**
 * @return the userService
 */
public UserService getUserService() {
return userService;
}

/**
 * @param userService
 *the userService to set
 */
public void setUserService(UserService userService) {
this.userService = userService;
}

/**
 * @return the id
 */
public Long getUserId() {
return userId;
}

/**
 * @param id
 *the id to set
 */
public void setUserId(Long id) {
this.userId = id;
log.debug("Setted id = " + id);
}

public String execute() {
user = userService.findUserById(userId);

log.debug("Loaded User = " + user);

return "success";
}

}

***

<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>


User - view




User:
Username:

Roles:

- 





***






/User/list.jsp



/User/view.jsp



Some code are omitted for easy read. Can anyone help me?

in the past i develop a PreparableAction loading user in prepare method,
but i need to use paramsPrepareParamsStack to run it. What is the best way?
load user in execute method or in prepare method?

Best regards

--
Filippo De Luca
[EMAIL PROTECTED]
http://www.filosganga.it
--
Circolo Canottieri Roma
Lungotevere Flaminio, 39 - 00196 - Roma - Italia
http://www.canottieriroma.com
--



Hello excuse me but this code is ok. But if the UserViewAction implements
ModelDriven so it implement the method:

   @Override
   public User getModel() {
   return getUser();
   }


And the jsp page become:



User:
Username:

Roles:

- 




The jsp page don't display anything? why? if the action is a modelDriven
this jsp page have to e correct!

Thanks

--
Filippo De Luca
[EMAIL PROTECTED]
http://www.filosganga.it
--
Circolo Canottieri Roma
Lungotevere Flaminio, 39 - 00196 - Roma - Italia
http://www.canottieriroma.com
--


Re: How to change colors to an item of a select tag list

2007-07-04 Thread yitzle

Um... is there corresponding HTML/AJAX code you know of that can
accomplish that?
I don't think I've ever seen the like.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Interceptors

2007-07-04 Thread Richard Sayre

I am new to struts and I am trying to write an interceptor.

I have the interceptor set up so it runs on every action (except one).
The interceptor checks the users session to make sure it has not
timed out.

If the session is after timing out I want to create a new session and
add some values to the an object we keep in session and redirect them
to the main page of our application.  I assumed if the interceptor
found that the session was expired then I could redirect to a
CreateSession action.


I have a few questions:


Is this a good use for an interceptor?

In the struts docs it says:
"Just like an action method, intercept returns a result used by
Struts to forward the request to another web resource"
I know how to call the next interceptor if everything works but how do
I call a different action if the session is timed out?

Is my logic is ok?

Thank you,

Rich

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Problem with s:action

2007-07-04 Thread Ramon Andrade

Hy guys,

I`m trying use the tag . The
param 'name' of this tag contains the name of a action that I create. The
result of this action redirect to a jsp that contains a combobox populated
with a iterator.

The problem is that, when the first page is loaded the content of the jsp
that is loaded by the s:action doesn`t is shown, but by debug I saw that the
action calling by tag s:action is performed but seems that the action do't
redirect to jsp result. And has also one more thing that i dont understand,
the param that I pass in s:action dont came setup it`s always null. 

Follow my jsp that contains .


<%@ taglib prefix="s" uri="/tags/struts-tags" %>







 


  


 





Follow the result(jsp) from action (sessionFilter) calling by :

<%@ taglib prefix="s" uri="/tags/struts-tags" %>




">





Follow part of my struts.xml


http://struts.apache.org/dtds/struts-2.0.dtd";>




...



 ...

 


admin/sessao/glb_contcma_sessao_filtrar.jsp 
admin/sessao/glb_contcma_sessao_filtrar.jsp




I`m doing or configuring something wrong? Is missing some interceptor?

Any help is welcome.

Thanks all.

-- 
View this message in context: 
http://www.nabble.com/Problem-with-s%3Aaction-tf4024697.html#a11431787
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Problem installing Struts 2

2007-07-04 Thread Hubert Hers
Hi,

I am new to Struts 2 and have a problem installing Struts 2 on tomcat
5.5.23.
After copying the war files to the webapps directory of tomcat(but did NOT
copy the jars anywhere), I get a problem deploying
struts2-portlet-2.0.8.war:


INFO: ... initialized Struts-Spring integration successfully
04.07.2007 16:47:53
com.opensymphony.xwork2.config.providers.InterceptorBuilder
constructInterceptorReference
WARNING: Unable to load config class
org.apache.struts2.portlet.interceptor.Port
letPreferencesInterceptor at interceptor -
jar:file:/C:/APPS/apache/apache-tomcat-5.5.23/webapps/struts2-portlet-2.0.8/
WEB-INF/lib/struts2-core-2.0.8.jar!/struts-portlet-default.xml:17:127
probably due to a missing jar, which might be fine
if you never plan to use the portlet-preferences interceptor
04.07.2007 16:47:53
com.opensymphony.xwork2.config.providers.InterceptorBuilder
constructInterceptorReference
SEVERE: Actual exception
Could not load class
org.apache.struts2.portlet.interceptor.PortletPreferencesInterceptor.
Perhaps it exists but certain dependencies are not available? - interceptor
- jar:file:/C:/APPS/apache/apache-tomcat-5.5.23/webapps/struts2-portlet-2
.0.8/WEB-INF/lib/struts2-core-2.0.8.jar!/struts-portlet-default.xml:17:127
at
com.opensymphony.xwork2.ObjectFactory.buildInterceptor(ObjectFactory.
java:206)
at
com.opensymphony.xwork2.config.providers.InterceptorBuilder.construct
InterceptorReference(InterceptorBuilder.java:57)
...

With the other 3 wars there is no issue.

Can someone please help?

Thx, Hubert



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[S2] vertical checkboxlist

2007-07-04 Thread Filippo De Luca

Dear Strtuts users
It is possible, in checkboxlist, to arrange checkboxes vertically?

Thanks

--
Filippo De Luca
[EMAIL PROTECTED]
http://www.filosganga.it
--
Circolo Canottieri Roma
Lungotevere Flaminio, 39 - 00196 - Roma - Italia
http://www.canottieriroma.com
--


Populate a s:select

2007-07-04 Thread Richard Sayre

There is a example for populating a select using alist on this page:

http://struts.apache.org/2.0.8/docs/select.html

I was wondering what:

list="petDao.pets"
listKey="id"
listValue="name"

are referring to?

Is petDao a java bean?  Is it an action?  How do you set it up on the
page?  What is pets?  Does it refer to petDao.getPets?  what does it
return?  What do id and name refer to?   Does getPets return a list of
objects that contain the fields name and id which have the getters and
setters for those fields?

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



unit testing interceptors

2007-07-04 Thread Session A Mwamufiya
Hi All,

Does anyone have a link to a simple example for unit testing an interceptor and 
creating a mock ActionInvocation?  The example in the Struts 2 documentation 
(http://struts.apache.org/2.0.8/docs/how-can-we-test-actions.html) is hard to 
understand and reuse in my code.

Thanks for any help,
Session


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Struts 2 and frames

2007-07-04 Thread Session A Mwamufiya
Hi,

This is the 3rd attempt I make to get an answer on how to force a jsp result 
page to be returned as a single window if html frames are used.  Please give me 
any hint as to how I can get this done.

Thanks,
Session


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Best Practice pass data into an included jsp

2007-07-04 Thread Ezra Jennings

I tried using s:include with nested s:param tags, but could not read the
parameters using the s:property tag at all.  The only way that I could read
the parameter was by using:

<%= "param1:" + request.getParameter("param1") %> 

as suggested in:
http://www.nabble.com/struts2-how-to-access-a-param-s%3Ainclude-tf2871075.html

I've had success with the following strategy (adapted to your example):

File: callPassRow.jsp

">
  
   
...



File: Random jsp's






This feels like a Tiles-like strategy to me -- which is actually how I'm
using it:

pageToBeDisplayed.jsp:




template.jsp:

Some text



so that includes/tile1.jsp gets included in template.jsp which is used to
make pageToBeDisplayed.jsp
It may not be the speediest operation, but it does provide flexibility.

Hope this helps...
Ezra

-- 
View this message in context: 
http://www.nabble.com/S2parameter-passing-%28newbie%29-question-tf3902253.html#a11437742
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Action tag with parameters

2007-07-04 Thread Asaf Paris Mandoki

When directly calling an action we can send a petition like

.../ActionName.action?var1=val1&var2=val2

using the GET method.

I understand that that calls an action with a couple of parameters.

Can I do something similar when calling an action from the 
tag ? that is, Can I call an action using the action tag with a couple
of parameters?

If possible, can it also be done using the POST method?

Thanks in advance,
Asaf

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Best Practice pass data into an included jsp

2007-07-04 Thread Chris Pratt

You might look into the Tiles project (http://tiles.apache.org), that's
exactly what it's designed to do.
 (*Chris*)

On 7/4/07, Ezra Jennings <[EMAIL PROTECTED]> wrote:



I tried using s:include with nested s:param tags, but could not read the
parameters using the s:property tag at all.  The only way that I could
read
the parameter was by using:

<%= "param1:" + request.getParameter("param1") %>

as suggested in:

http://www.nabble.com/struts2-how-to-access-a-param-s%3Ainclude-tf2871075.html

I've had success with the following strategy (adapted to your example):

File: callPassRow.jsp

">
  
   
...



File: Random jsp's






This feels like a Tiles-like strategy to me -- which is actually how I'm
using it:

pageToBeDisplayed.jsp:




template.jsp:

Some text



so that includes/tile1.jsp gets included in template.jsp which is used to
make pageToBeDisplayed.jsp
It may not be the speediest operation, but it does provide flexibility.

Hope this helps...
Ezra

--
View this message in context:
http://www.nabble.com/S2parameter-passing-%28newbie%29-question-tf3902253.html#a11437742
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




[S2] App produces lot garbage IMPORTANT NEWS (I HOPE)

2007-07-04 Thread Ing. Andrea Vettori

Hi,

for the readers of my previous messages I'm still facing the problem.  
After having upgraded the application server and even re-designed  
some code to not use JMS to exclude some possible causes now I think  
I've found something interesting. And it's struts related.


I've keeped some threads dump of when the server continually allocate  
and garbage collect large amount of data. Today I take seven of them.


Looking carefully to all of them I noticed there is ALWAYS the same  
http thread that's on the struts  tag handler on a  
specific jsp page. This page is used about one hundred times a day.  
But when the server is generating garbage there is always a thread in  
it. Moreover I trace the visits on a sql database so I'm sure that  
the thread is somewhat "locked" into that page and it's not many  
different visits to the same page.


Below you'll find the threads dump taken a few seconds one after the  
other,  in a moment when the server is producing garbage.


I'm not a thread dump expert reader but it seems to me that's some  
infinite loop that starts on org/apache/struts2/views/jsp/ 
ComponentTagSupport.doEndTag(ComponentTagSupport.java:43)


The jsp source is at http://www.andreavettori.com/trace/ 
carrelloB_jsp.java


This page is "special" because there are TWO struts forms (with  
different name) both with a textfield and a password field, with the  
same name in the two forms. Both point to the same action class with  
different action name in struts.conf. Not sure if this is peculiar or  
not.


I'll try to read the sources of the various methods called in the  
thread dump but I hope that someone more expert on the struts source  
code can help me found IF this is the source of my problems.


P.S.
I'm using the simple template.


Thanks



"http-10.1.2.8-8080-1" id=85 idx=0x148 tid=12294 prio=5 alive, daemon
at java/util/HashMap.get(Ljava/lang/Object;)Ljava/lang/Object; 
(Unknown Source)[optimized]
at com/opensymphony/xwork2/util/OgnlUtil.compile(OgnlUtil.java: 
200)[inlined]
at com/opensymphony/xwork2/util/OgnlUtil.getValue(OgnlUtil.java: 
194)[inlined]
at com/opensymphony/xwork2/util/OgnlValueStack.findValue 
(OgnlValueStack.java:238)[optimized]

^-- Holding lock: java/util/[EMAIL PROTECTED] lock]
at com/opensymphony/xwork2/util/TextParseUtil.translateVariables 
(TextParseUtil.java:122)
at com/opensymphony/xwork2/util/TextParseUtil.translateVariables 
(TextParseUtil.java:71)
at org/apache/struts2/components/Component.findValue 
(Component.java:313)
at org/apache/struts2/components/UIBean.evaluateParams 
(UIBean.java:723)

at org/apache/struts2/components/UIBean.end(UIBean.java:481)
at org/apache/struts2/views/jsp/ComponentTagSupport.doEndTag 
(ComponentTagSupport.java:43)
at org/apache/jsp/carrelloB_jsp._jspx_meth_s_005fpassword_005f0 
(carrelloB_jsp.java:694)
at org/apache/jsp/carrelloB_jsp._jspx_meth_s_005fform_005f2 
(carrelloB_jsp.java:634)

at org/apache/jsp/carrelloB_jsp._jspService(carrelloB_jsp.java:133)


"http-10.1.2.8-8080-1" id=85 idx=0x148 tid=12294 prio=5 alive, daemon
at com/opensymphony/xwork2/util/TextParseUtil.translateVariables 
(TextParseUtil.java:113)
at com/opensymphony/xwork2/util/TextParseUtil.translateVariables 
(TextParseUtil.java:71)
at org/apache/struts2/components/Component.findValue 
(Component.java:313)
at org/apache/struts2/components/UIBean.evaluateParams 
(UIBean.java:723)

at org/apache/struts2/components/UIBean.end(UIBean.java:481)
at org/apache/struts2/views/jsp/ComponentTagSupport.doEndTag 
(ComponentTagSupport.java:43)
at org/apache/jsp/carrelloB_jsp._jspx_meth_s_005fpassword_005f0 
(carrelloB_jsp.java:694)
at org/apache/jsp/carrelloB_jsp._jspx_meth_s_005fform_005f2 
(carrelloB_jsp.java:634)

at org/apache/jsp/carrelloB_jsp._jspService(carrelloB_jsp.java:133)


"http-10.1.2.8-8080-1" id=85 idx=0x148 tid=12294 prio=5 alive, daemon
at java/util/HashMap.put(Ljava/lang/Object;Ljava/lang/Object;) 
Ljava/lang/Object;(Unknown Source)[optimized]

at ognl/OgnlContext.put(OgnlContext.java:477)[optimized]
at com/opensymphony/xwork2/util/OgnlValueStack 
$ObjectAccessor.getProperty(OgnlValueStack.java:61)[optimized]

at ognl/OgnlRuntime.getProperty(OgnlRuntime.java:1643)[inlined]
at com/opensymphony/xwork2/util/CompoundRootAccessor.getProperty 
(CompoundRootAccessor.java:101)[optimized]

at ognl/OgnlRuntime.getProperty(OgnlRuntime.java:1643)[inlined]
at ognl/ASTProperty.getValueBody(ASTProperty.java:92)[optimized]
at ognl/SimpleNode.evaluateGetValueBody(SimpleNode.java:170) 
[optimized]

at ognl/SimpleNode.getValue(SimpleNode.java:210)[optimized]
at ognl/Ognl.getValue(Ognl.java:333)[inlined]
at com/opensymphony/xwork2/util/OgnlUtil.getValue(OgnlUtil.java: 
194)[inlined]
at com/opensymphony/xwork2/util/OgnlValueStack.findValue 
(OgnlValueStack.java:238)[optimized]
at com/opensymphony/xwork2/util/TextParseUtil.tra

Re: Populate a s:select

2007-07-04 Thread Dave Newton
--- Richard Sayre <[EMAIL PROTECTED]> wrote:
> http://struts.apache.org/2.0.8/docs/select.html
> 
> I was wondering what:
> 
> list="petDao.pets"
> listKey="id"
> listValue="name"
> 
> are referring to?
> 
> 1) Is petDao a java bean?  2) Is it an action?  
> 3) How do you set it up on the page?  4) What is 
> pets?  5) Does it refer to petDao.getPets?  6) what 
> does it return?  7) What do id and name refer to?   
> 8) Does getPets return a list of objects that
contain
> the fields name and id which have the getters and 
> setters for those fields?

...

1) Yes.

2) No.

3) I don't know what that means.

4,5) It's a property of petDao, yes.

6) From the link you provided: "Iterable source to
populate from."

7) From the link you provided:

listKey: Property of list objects to get field value
from
listValue: Property of list objects to get field
content from

8) Hope so.

d.



   

Be a better Heartthrob. Get better relationship answers from someone who knows. 
Yahoo! Answers - Check it out. 
http://answers.yahoo.com/dir/?link=list&sid=396545433

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Populate a s:select

2007-07-04 Thread Richard Sayre

On 7/4/07, Dave Newton <[EMAIL PROTECTED]> wrote:

--- Richard Sayre <[EMAIL PROTECTED]> wrote:
> http://struts.apache.org/2.0.8/docs/select.html
>
> I was wondering what:
>
> list="petDao.pets"
> listKey="id"
> listValue="name"
>
> are referring to?
>
> 1) Is petDao a java bean?  2) Is it an action?
> 3) How do you set it up on the page?  4) What is
> pets?  5) Does it refer to petDao.getPets?  6) what
> does it return?  7) What do id and name refer to?
> 8) Does getPets return a list of objects that
contain
> the fields name and id which have the getters and
> setters for those fields?

...

1) Yes.

2) No.

3) I don't know what that means.

4,5) It's a property of petDao, yes.

6) From the link you provided: "Iterable source to
populate from."

7) From the link you provided:

listKey: Property of list objects to get field value
from
listValue: Property of list objects to get field
content from

8) Hope so.

d.







Thanks.  I have a better understanding now.

By number 3 I meant, how do I reference the action, but I realized
this is done when I create the action in struts.xml.  I was confused
about #6.  I didn't know if I could use a Java object or not.  ie. I
thought I had to build the OGNL list expression string and pass it
back.

With #7/#8.  If petsDao.pets is an ArrayList does listKey="fieldName"
and listValue="fieldName2" mean that to get these values, call
getFieldName() getFieldName2() on the objects stored in the ArrayList?
IF so, do I need to use generics so it knows what object to expect?

I have one other question:

If I have a Hashtable with the following data:
1,"One"
2,"Two"
11,"Eleven"

Is it possible to make the select box display the data sorting by id
or sorting by value?

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [S2] App produces lot garbage IMPORTANT NEWS (I HOPE)

2007-07-04 Thread Ing. Andrea Vettori

All the traces points me to this function on the xwork library
Since it contains an infinte loop it's promising ;)
Need to sleep now, I hope tomorrow to find someone else solution in  
my inbox :)


Thank you




public static Object translateVariables(char open, String  
expression, ValueStack stack, Class asType, ParsedValueEvaluator  
evaluator) {

// deal with the "pure" expressions first!
//expression = expression.trim();
Object result = expression;

while (true) {
int start = expression.indexOf(open + "{");
int length = expression.length();
int x = start + 2;
int end;
char c;
int count = 1;
while (start != -1 && x < length && count != 0) {
c = expression.charAt(x++);
if (c == '{') {
count++;
} else if (c == '}') {
count--;
}
}
end = x - 1;

if ((start != -1) && (end != -1) && (count == 0)) {
String var = expression.substring(start + 2, end);

Object o = stack.findValue(var, asType);
if (evaluator != null) {
o = evaluator.evaluate(o);
}


String left = expression.substring(0, start);
String right = expression.substring(end + 1);
if (o != null) {
if (TextUtils.stringSet(left)) {
result = left + o;
} else {
result = o;
}

if (TextUtils.stringSet(right)) {
result = result + right;
}

expression = left + o + right;
} else {
// the variable doesn't exist, so don't display  
anything

result = left + right;
expression = left + right;
}
} else {
break;
}
}

return XWorkConverter.getInstance().convertValue 
(stack.getContext(), result, asType);

}



--
Ing. Andrea Vettori
Consulente per l'Information Technology



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Checkboxes problem

2007-07-04 Thread tom tom
because you have the list, you can do the following



You dont need to iterate


--- Andreja <[EMAIL PROTECTED]> wrote:

> Thank you very much Sharad, that WORKS! :]
> 
> 
> 
> Just for the archive, this is also a possibility:
> 
> 
>  fieldValue="${manyNames[cnt.index]}">
>   
> 
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 



   

Choose the right car based on your needs.  Check out Yahoo! Autos new Car 
Finder tool.
http://autos.yahoo.com/carfinder/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[S2] FreeMarker sample application

2007-07-04 Thread Mark P Ashworth

Good Day,

I have been using FreeMarker for the S2 plug-in development and some other
projects. I find the FTL language more expressive than JSP and I was
wondering if there is a sample S2 application that makes use of FTL for the
views.

Regards,
Mark P Ashworth
http://www.connext.co.za
-- 
View this message in context: 
http://www.nabble.com/-S2--FreeMarker-sample-application-tf4027968.html#a11441567
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problem installing Struts 2

2007-07-04 Thread java_user

Hi,

could you please provide struts2 version?

thanks
ramesh


Hubert Hers wrote:
> 
> Hi,
> 
> I am new to Struts 2 and have a problem installing Struts 2 on tomcat
> 5.5.23.
> After copying the war files to the webapps directory of tomcat(but did NOT
> copy the jars anywhere), I get a problem deploying
> struts2-portlet-2.0.8.war:
> 
> 
> INFO: ... initialized Struts-Spring integration successfully
> 04.07.2007 16:47:53
> com.opensymphony.xwork2.config.providers.InterceptorBuilder
> constructInterceptorReference
> WARNING: Unable to load config class
> org.apache.struts2.portlet.interceptor.Port
> letPreferencesInterceptor at interceptor -
> jar:file:/C:/APPS/apache/apache-tomcat-5.5.23/webapps/struts2-portlet-2.0.8/
> WEB-INF/lib/struts2-core-2.0.8.jar!/struts-portlet-default.xml:17:127
> probably due to a missing jar, which might be fine
> if you never plan to use the portlet-preferences interceptor
> 04.07.2007 16:47:53
> com.opensymphony.xwork2.config.providers.InterceptorBuilder
> constructInterceptorReference
> SEVERE: Actual exception
> Could not load class
> org.apache.struts2.portlet.interceptor.PortletPreferencesInterceptor.
> Perhaps it exists but certain dependencies are not available? -
> interceptor
> - jar:file:/C:/APPS/apache/apache-tomcat-5.5.23/webapps/struts2-portlet-2
> .0.8/WEB-INF/lib/struts2-core-2.0.8.jar!/struts-portlet-default.xml:17:127
> at
> com.opensymphony.xwork2.ObjectFactory.buildInterceptor(ObjectFactory.
> java:206)
> at
> com.opensymphony.xwork2.config.providers.InterceptorBuilder.construct
> InterceptorReference(InterceptorBuilder.java:57)
> ...
> 
> With the other 3 wars there is no issue.
> 
> Can someone please help?
> 
> Thx, Hubert
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Problem-installing-Struts-2-tf4024879.html#a11441712
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[S2] Default Action

2007-07-04 Thread Chris Pratt

I am trying to figure out how to set the default class that is executed when
a class is not specified on an  declaration.  When you specify
something like:


 /home.jsp


Struts automatically runs com.opensymphony.xwork2.ActionSupport.  But I am
trying to figure out how to accomplish this:


 user
 /home.jsp


Since ActionSupport doesn't have a setRole method, this won't work out of
the box, so I created a simple extension of ActionSupport to hold the role
value.  After a bit of googling, I got the idea that this should work:





but that doesn't seem to do the job.  Is it possible?  Is there another way
to specify this type of information on a per Action basis?  Any insights
would be appreciated.
 (*Chris*)