Re: OutOfMemoryError: PermGen space!!!! Dont know why?

2010-07-12 Thread RogerV



abhishek jain-11 wrote:
> 
> Hi friends,
> I need urgent help, i have developed an application but when i run that on
> server i get the following error,
> I am using Tomcat 5.5 and Struts 1.1 , i develpoed application using
> Myeclipse, do i need to optimize application by removing some libraries
> before deploying or so.
> Pl. help
> 

Alternatively, if you are using Tomcats hot deploy you are probably running
into the Tomcat memory leak. It's an ongoing problem that is still present
in the current 6.0.26 version. If you're developing in Eclipse then the
problem is probably being made worse by Eclipses default behaviour to
re-deploy after every change to the source. If this is the case then no
amount of adjusting your code as going to help you and no matter how much
memory you allocate to the JVM you are going to hit this at some point. The
only way around this is to periodically shut down and re-start Tomcat. 

The developers reckon that they've finally solved this in Tomcat 7 which is
currently in beta.

Regards
-- 
View this message in context: 
http://old.nabble.com/OutOfMemoryError%3A-PermGen-space%21%21%21%21-Dont-know-why--tp29114902p29146903.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: Javascript issues

2010-07-12 Thread JP Cafaro
The problem was...stupid enough...not having a  end tag.  
Apparently I can't type 


Martin Gainty wrote:

ajax controls allow asynchronous population of div tags..there needs to be some 
sort of notify/listener capability to triggger the listener to wakeup and 
populate the div tag

when the event is being notified e.g.



   function handler(widget, node) {

 
 alert('I will handle this myself!');
  node.innerHTML = "%{Action.Bean}%"; //the contents of the div tag get 
populated here
   }







RE: Javascript issues

2010-07-12 Thread Martin Gainty

ajax controls allow asynchronous population of div tags..there needs to be some 
sort of notify/listener capability to triggger the listener to wakeup and 
populate the div tag

when the event is being notified e.g.



   function handler(widget, node) {

 
 alert('I will handle this myself!');
  node.innerHTML = "%{Action.Bean}%"; //the contents of the div tag get 
populated here
   }






 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 
  
_
The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with 
Hotmail. 
http://www.windowslive.com/campaign/thenewbusy?tile=multicalendar&ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_5

RE: Struts 1 binding vulnerability

2010-07-12 Thread Zheng, Xiahong
Created and attached a patch. Please have a look at the issue 
https://issues.apache.org/jira/browse/STR-3206 

-Original Message-
From: paulus.benedic...@gmail.com [mailto:paulus.benedic...@gmail.com] On 
Behalf Of Paul Benedict
Sent: Monday, July 12, 2010 3:13 PM
To: Struts Users Mailing List
Subject: Re: Struts 1 binding vulnerability

Open a JIRA ticket and submit a patch. We welcome help from the community.

On Mon, Jul 12, 2010 at 2:06 PM, Zheng, Xiahong  wrote:
> Hi,
>
> Spring recently released the following security vulnerability in its MVC data 
> binding framework. Here is the description
>
> The Spring Framework provides a mechanism to use client provided data to 
> update the properties of an object. This mechanism allows an attacker to 
> modify the properties of the class loader used to load the object (via 
> 'class.classloader'). This can lead to arbitrary command execution since, for 
> example, an attacker can modify the URLs used by the class loader to point to 
> locations controlled by the attacker.
>
> For full description, follow this link 
> http://www.springsource.com/security/cve-2010-1622
>
> Although Struts is not vulnerable to the exact attack described in the cve, 
> we found Struts' binding mechanism do expose the opportunities for an 
> attacker to manipulate other classloader properties such as "delegationMode", 
> "jarPath", "antiJarLocking", etc. I am wondering if the Struts team is aware 
> of this and any plans to have a fix in the near future.
>
> Thanks,
> Xiaohong Zheng
>
>
>
>
> -
> 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



Re: Struts 1 binding vulnerability

2010-07-12 Thread Paul Benedict
Open a JIRA ticket and submit a patch. We welcome help from the community.

On Mon, Jul 12, 2010 at 2:06 PM, Zheng, Xiahong  wrote:
> Hi,
>
> Spring recently released the following security vulnerability in its MVC data 
> binding framework. Here is the description
>
> The Spring Framework provides a mechanism to use client provided data to 
> update the properties of an object. This mechanism allows an attacker to 
> modify the properties of the class loader used to load the object (via 
> 'class.classloader'). This can lead to arbitrary command execution since, for 
> example, an attacker can modify the URLs used by the class loader to point to 
> locations controlled by the attacker.
>
> For full description, follow this link 
> http://www.springsource.com/security/cve-2010-1622
>
> Although Struts is not vulnerable to the exact attack described in the cve, 
> we found Struts' binding mechanism do expose the opportunities for an 
> attacker to manipulate other classloader properties such as "delegationMode", 
> "jarPath", "antiJarLocking", etc. I am wondering if the Struts team is aware 
> of this and any plans to have a fix in the near future.
>
> Thanks,
> Xiaohong Zheng
>
>
>
>
> -
> 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



Struts 1 binding vulnerability

2010-07-12 Thread Zheng, Xiahong
Hi,

Spring recently released the following security vulnerability in its MVC data 
binding framework. Here is the description

The Spring Framework provides a mechanism to use client provided data to update 
the properties of an object. This mechanism allows an attacker to modify the 
properties of the class loader used to load the object (via 
'class.classloader'). This can lead to arbitrary command execution since, for 
example, an attacker can modify the URLs used by the class loader to point to 
locations controlled by the attacker.

For full description, follow this link 
http://www.springsource.com/security/cve-2010-1622

Although Struts is not vulnerable to the exact attack described in the cve, we 
found Struts' binding mechanism do expose the opportunities for an attacker to 
manipulate other classloader properties such as "delegationMode", "jarPath", 
"antiJarLocking", etc. I am wondering if the Struts team is aware of this and 
any plans to have a fix in the near future.

Thanks,
Xiaohong Zheng




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



Re: Help Struts2 + interceptor

2010-07-12 Thread Fabio Alves de Araujo Ebner - DnaSolution

Hey man, this is my structure


MY ACTION

package br.com.dnasolution.site.action;


/** import **//


@ParentPackage("my-secure")

public class OrdemServicoAction {

@Action(value = "cadastrarOrdemServico", results = {...@result(name = "valido", 
location = "/jsp/ordemservico/cadastro_sucesso.jsp"), @Result(name = 
"invalido", location = "/jsp/ordemservico/cadastro_falha.jsp") }, 
interceptorRefs = { @InterceptorRef("loginClienteInterceptor") })

public String cadastrarOrdemServico() {
   /* code */
}



MY INTERCEPTOR

package br.com.dnasolution.site.interceptor;

import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.Interceptor;

public class LoginClienteInterceptor implements Interceptor {

@Override
public void destroy() {
 // TODO Auto-generated method stub

}

@Override
public void init() {
 // TODO Auto-generated method stub

}

@Override
public String intercept(ActionInvocation invocation) throws Exception {
 if(invocation.getInvocationContext().getSession().get("clienteLogado") != 
null){

  return invocation.invoke();
 }else{
  return "clienteNaoLogado";
 }
}

}



AND MY STRUTS.XML

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
































/jsp/usuario/loginUsuario.jsp



/jsp/cliente/loginCliente.jsp















and still dosen't work :(


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



Re: Javascript issues

2010-07-12 Thread JP Cafaro

I think the problem has to do with this line:



When I use firefox, and view the source, I can click on the link to 
ajax-user-browser.js and it can't find the resource.  I think this is 
because it's under my WEB-INF directory.  I moved ajax-user-browser.js 
to a folder "js" on the same level as WEB-INF and changed the line to:




but it still doesn't work!  Nothing shows up on the page.  However when I view 
the source
this time, I can click the link and I do see the code for the javascript.  
Please help!



JP Cafaro wrote:
I'm trying to incorporate some ajax stuff with struts2 but I'm running 
into problems.


I have this action:
public class AjaxUserBrowser extends ActionSupport
{
   private List users;
 public String execute()
   {
   System.out.println("AJAX USER BROWSER");
   setUsers(getPortfolioService().getUsers());
   return SUCCESS;
   }
 public PortfolioService getPortfolioService( ){
   return new PortfolioService();
   }

   public void setUsers(List users)
   {
   this.users = users;
   }

   public List getUsers()
   {
   return users;
   }
}

It's very simple.  It doesn't really do anything.
Then I have this resulting jsp page:

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
   pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>

http://www.w3.org/1999/xhtml";>




Title


Artist Browser Control
 listValue="username" label="Select an artist" value="defaultUsername" 
onchange="fetchUser();"/>

  Artist Information   
 Name:  value="defaultUser.lastName"/>

 
   PortfolioName: 
 
  



When I click the link to the action, nothing appears on the resulting 
page.  The action fires (print statement is printed) but no resulting 
page is shown.  If I view the source, the html is right, and if I take 
out the 

Re: Help Struts2 + interceptor

2010-07-12 Thread JP Cafaro

Here's how I do it:

struts.xml:

   
   class="interceptors.AuthenticationInterceptor" />

   
   
   
   
   

   
   

where my-default is another package that extends struts-default,

Then I have a package-info.java file in each package that has actions 
that need to use this interceptor, for example:


@ParentPackage("my-secure")

package actions.secure;

import org.apache.struts2.convention.annotation.ParentPackage;

Note, I'm using the convention plugin

Fabio Alves de Araujo Ebner - DnaSolution wrote:

so i put in my aciotn

ParentPackage("loginClienteAndUsuario")

and i got the same problem
- Original Message - From: "JP Cafaro" 
To: "Struts Users Mailing List" 
Sent: Monday, July 12, 2010 2:18 PM
Subject: Re: Help Struts2 + interceptor


The action has to be a part of that package, it has to extend that 
package.


Fabio Alves de Araujo Ebner - DnaSolution wrote:


Hi, i need help to use interceptor, i create one to test if the user 
are logged in my application until he execute one Action, but when 
the server pass throw interceptor and back to action, all my var are 
null, this is my struts.xml


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















/jsp/usuario/loginUsuario.jsp
/jsp/cliente/loginCliente.jsp






tks




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




 





No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.830 / Virus Database: 271.1.1/2998 - Release Date: 
07/12/10 03:36:00



-
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: Help Struts2 + interceptor

2010-07-12 Thread Fabio Alves de Araujo Ebner - DnaSolution

so i put in my aciotn

ParentPackage("loginClienteAndUsuario")

and i got the same problem
- Original Message - 
From: "JP Cafaro" 

To: "Struts Users Mailing List" 
Sent: Monday, July 12, 2010 2:18 PM
Subject: Re: Help Struts2 + interceptor


The action has to be a part of that package, it has to extend that 
package.


Fabio Alves de Araujo Ebner - DnaSolution wrote:


Hi, i need help to use interceptor, i create one to test if the user are 
logged in my application until he execute one Action, but when the server 
pass throw interceptor and back to action, all my var are null, this is 
my struts.xml


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















/jsp/usuario/loginUsuario.jsp
/jsp/cliente/loginCliente.jsp






tks




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








No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.830 / Virus Database: 271.1.1/2998 - Release Date: 07/12/10 
03:36:00



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



Re: Help Struts2 + interceptor

2010-07-12 Thread JP Cafaro

The action has to be a part of that package, it has to extend that package.

Fabio Alves de Araujo Ebner - DnaSolution wrote:
 
Hi, i need help to use interceptor, i create one to test if the user are logged in my application until he execute one Action, but when the server pass throw interceptor and back to action, all my var are null, this is my struts.xml 

http://struts.apache.org/dtds/struts-2.0.dtd";> 
 extends="struts-default"> 
 
 class="br.com.dnasolution.site.interceptor.LoginUsuarioInterceptor"> 
 
 class="br.com.dnasolution.site.interceptor.LoginClienteInterceptor"> 
 
 
 
 
 
 
 
 
 
/jsp/usuario/loginUsuario.jsp 
/jsp/cliente/loginCliente.jsp 
 

 
 



tks 

  


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



Help Struts2 + interceptor

2010-07-12 Thread Fabio Alves de Araujo Ebner - DnaSolution
 
Hi, i need help to use interceptor, i create one to test if the user are logged 
in my application until he execute one Action, but when the server pass throw 
interceptor and back to action, all my var are null, this is my struts.xml 

http://struts.apache.org/dtds/struts-2.0.dtd";> 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/jsp/usuario/loginUsuario.jsp 
/jsp/cliente/loginCliente.jsp 
 

 
 


tks 


Re: [S2] post JSON to REST

2010-07-12 Thread mailtolouis2020-struts
Hi,

Ok, I found my problem, I was using restTemplate to do the post, and it set the 
content type to application/json;charset=UTF-8, so now my question is how to 
configure rest-plugin to accept application/json;charset=UTF-8 and handle by 
json lib?

Regards
LV






From: Frans Thamura 
To: Struts Users Mailing List 
Sent: Mon, July 12, 2010 3:51:49 PM
Subject: Re: [S2] post JSON to REST

We use http post

But dunno how to send via json rpc
(m)

-Original Message-
From: mailtolouis2020-str...@yahoo.com
Date: Mon, 12 Jul 2010 07:29:53 
To: Struts Users Mailing List
Reply-To: "Struts Users Mailing List" 
Subject: [S2] post JSON to REST



Hi,



Sorry if this is double posted, because I didn't receive the mail which I post.

I'm new to the struts2 rest plugin, I hope someone can help me.

I'm trying to post a json data to a UserController, I can see create method is 
invoked, but the json data is not set to the UserController.

Here is the json data:
{"user":{"userName":"TestUser","userEmail":"testu...@yahoo.com"}}

In my UserController, I've defined these getter/setter

public void setModel(UserBean bean)
public UserBean getModel()
public void setUser(UserBean bean)
public UserBean getUser()
public void  setUserName(String name)
public String getUserName()
public void setUserEmail(String email)
public String getUserEmail()

>From the log, I can c getModel(), validate(), create() are called, but no one 
setting anything to the controller.

Do I need to do extra thing to receive the json data?

The GET is working fine when I want to get some data from the UserController.

I've been searching the net pass 2 days, unfortunately most info are about GET, 
not POST or PUT.

I hope your guys can help me.

THanks
LV


Javascript issues

2010-07-12 Thread JP Cafaro
I'm trying to incorporate some ajax stuff with struts2 but I'm running 
into problems.


I have this action:
public class AjaxUserBrowser extends ActionSupport
{
   private List users;
  
   public String execute()

   {
   System.out.println("AJAX USER BROWSER");
   setUsers(getPortfolioService().getUsers());
   return SUCCESS;
   }
  
   public PortfolioService getPortfolioService( ) 
   {

   return new PortfolioService();
   }

   public void setUsers(List users)
   {
   this.users = users;
   }

   public List getUsers()
   {
   return users;
   }
}

It's very simple.  It doesn't really do anything. 


Then I have this resulting jsp page:

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
   pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>

http://www.w3.org/1999/xhtml";>



Title


Artist Browser Control  
  
 listValue="username" label="Select an artist" value="defaultUsername" 
onchange="fetchUser();"/> 
 
  
  Artist Information 
  
 Name:  value="defaultUser.lastName"/>

 
   PortfolioName: 
 
  



When I click the link to the action, nothing appears on the resulting 
page.  The action fires (print statement is printed) but no resulting 
page is shown.  If I view the source, the html is right, and if I take 
out the 

Re: convention plugin 2.1.8.1 and JBoss 5.1

2010-07-12 Thread Scott Miller

Yes,

The problem seems to be that struts 2 convention plugin is attempting  
to load the classes by loading files from the war file that is still  
inside the ear in the deploy directory of your jboss server.  This  
virtual file can't be loaded in the mechanism being provided by the  
convention plugin and therefore fails.


I am going to get around this by adding:

name="convention" class="com.myapp.MyPackageBasedActionConfigBuilder"/>


To struts.xml and extending the convention plugin provided  
ActionConfigBuilder.  My class will override the findActions method  
and then just include my action classes that I register manually.   
This is not ideal, but it will allow me to proceed and use the  
convention plugin without the automated discovery process.  If I have  
more time to dedicate to this later I will try and figure out a better  
way to actually handle the situation.  If so I will post the solution  
back to the list then.


-Scott

On Jul 12, 2010, at 1:50 AM, mid491 mid491 wrote:


Hi,

I got the same problem : when my WAR is inside the EAR the plugin  
doesn't work, if I deploy the war alone, all works fine!


tell me if you find an issue?

DT

> From: miller.sc...@gmail.com
> To: user@struts.apache.org
> Subject: convention plugin 2.1.8.1 and JBoss 5.1
> Date: Fri, 9 Jul 2010 22:27:46 -0700
>
> I have been unable to get the struts convention plugin to work on
> JBoss 5.1.
>
> If I set
>
>  value="true" />
>
> as per the convention plugin documentation, and debug through the
> setup code, I notice that the WEB-INF/classes directory in my war
> (which is deployed in an ear) gets removed from the set of URL's to
> search for action classes.
>
> Switching that constant to 'false' allows the WEB-INF/classes
> directory to remain in the set of URL's, but then I get this error
> when it attempts to load the war:
>
> 2010-07-09 22:14:03,102 ERROR [CommonsLogger.java:27] : Unable to  
read

> URL [vfszip://server/default/deploy/myapp.ear/myapp-
> web.war/WEB-INF/classes/]
> java.io.FileNotFoundException: /< JBOSS_HOME_DIR>/server/default/
> deploy/myapp.ear/myapp-web.war/WEB-INF/classes
> at
> org
> .jboss
> 
 .net.protocol.file.FileURLConnection.connect(FileURLConnection.java: 
105)

> at
> org
> .jboss
> .net
> 
 .protocol 
.file.FileURLConnection.getInputStream(FileURLConnection.java:

> 112)
> at java.net.URL.openStream(URL.java:1007)
> at
>  
com.opensymphony.xwork2.util.finder.ClassFinder.jar(ClassFinder.java:

> 464)
> at
> com
> 
 .opensymphony.xwork2.util.finder.ClassFinder.(ClassFinder.java:

> 129)
> at
> org
> .apache
> .struts2
> .convention
> .PackageBasedActionConfigBuilder
> .findActions(PackageBasedActionConfigBuilder.java:352)
> at
> org
> .apache
> .struts2
> .convention
> .PackageBasedActionConfigBuilder
> .buildActionConfigs(PackageBasedActionConfigBuilder.java:317)
> at
> org
> .apache
> .struts2
> .convention
> 
 .ClasspathPackageProvider 
.loadPackages(ClasspathPackageProvider.java:53)

>
>
> Is there some magical configuration setting I am missing? or does  
this

> just not work on JBoss 5.1 when deploying inside of an ear?
>
> Thanks,
>
> Scott
>

De nouvelles Emoticones sur Messenger ? Téléchargez gratuitement les  
émoticônes Summer !




validating integer, java.lang.NoSuchMethodException

2010-07-12 Thread Jake Vang
hi,

i am trying to validate an integer field (int primitive type) on a
POJO (i.e. MyPojo.integer). i have the validation defined in
--validation.xml as follows.

...

 
  Integer is required!
 

...

when the form posts to the action, if the value of  is left blank, i keep seeing a
java.lang.NoSuchMethodException:
MyPojo.setInteger([Ljava.lang.String;). why is struts trying to insert
a string into this int field?  the field value is "blank" (empty), so
i'd expect struts to be smart enough to see this and not try to insert
anything and just return back to the form with the validation error.

it should be very easy to define the following validation rules:
1. myPojo.integer is required
2. myPojo.integer is an integer

however, it is NOT that easy. here's a set of validation rules that i
tried and did not succeed.


 
 
  Integer is required!
 
 
 
  
  Please enter an integer!
 


when i use this set of validation rules, i also observe the same
NoSuchMethodException. this time, however, i do NOT see that the
validation works (because I do not see the message, Integer is
required!).

something like the following works, but STILL, i see the
NoSuchMethodException thrown if the field's value is left blank.
...

 1
 10
 Integer must be between ${min} and ${max}, current value is
${myPojo.integer}.

...

however, this last validation rule is absolutely the WORST one to use
because if the value on the form is left blank, 1) i will see the
NoSuchMethoException thrown and 2) if i allow for min=0 and max=10,
the validation will never know if the user entered 0 or was the 0
because there was no value!

any ideas is appreciated. i already experimented a lot and did not
come up with anything that is why this post is rather long.

thanks.

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



Re: validating integer, java.lang.NoSuchMethodException

2010-07-12 Thread Jake Vang
a workaround to this problem is to have a string field in the Action
class to represent MyPojo.integer. using this approach, the second set
of validation rules below work 100% and i no longer see the
NoSuchMethodException. however, the drawback is that now i have to
transfer this to my backing bean.

oh well, you win some, you lose some. if anyone has a better idea,
please let me know.

thanks.

On Mon, Jul 12, 2010 at 11:26 AM, Jake Vang  wrote:
> hi,
>
> i am trying to validate an integer field (int primitive type) on a
> POJO (i.e. MyPojo.integer). i have the validation defined in
> --validation.xml as follows.
>
> ...
> 
>  
>  Integer is required!
>  
> 
> ...
>
> when the form posts to the action, if the value of  name="myPojo.integer"/> is left blank, i keep seeing a
> java.lang.NoSuchMethodException:
> MyPojo.setInteger([Ljava.lang.String;). why is struts trying to insert
> a string into this int field?  the field value is "blank" (empty), so
> i'd expect struts to be smart enough to see this and not try to insert
> anything and just return back to the form with the validation error.
>
> it should be very easy to define the following validation rules:
> 1. myPojo.integer is required
> 2. myPojo.integer is an integer
>
> however, it is NOT that easy. here's a set of validation rules that i
> tried and did not succeed.
>
> 
>  
>  
>  Integer is required!
>  
>  
>  
>  
>  Please enter an integer!
>  
> 
>
> when i use this set of validation rules, i also observe the same
> NoSuchMethodException. this time, however, i do NOT see that the
> validation works (because I do not see the message, Integer is
> required!).
>
> something like the following works, but STILL, i see the
> NoSuchMethodException thrown if the field's value is left blank.
> ...
> 
>  1
>  10
>  Integer must be between ${min} and ${max}, current value is
> ${myPojo.integer}.
> 
> ...
>
> however, this last validation rule is absolutely the WORST one to use
> because if the value on the form is left blank, 1) i will see the
> NoSuchMethoException thrown and 2) if i allow for min=0 and max=10,
> the validation will never know if the user entered 0 or was the 0
> because there was no value!
>
> any ideas is appreciated. i already experimented a lot and did not
> come up with anything that is why this post is rather long.
>
> thanks.
>

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



Re: OutOfMemoryError: PermGen space!!!! Dont know why?

2010-07-12 Thread Philipp Leusmann
 Use JConsole 
 or 
if you need more details a profiling tool like Yourkit


Am 12.07.2010 17:04, schrieb abhishek jain:

Hi,
How can i check how much memory is it currently consuming / using.

thanks
abhishek

On Sun, Jul 11, 2010 at 6:34 AM, Martin Gainty  wrote:


sounds as if class and method objects could possibly be missed by GC..try
this for running under Jboss using Sun JVM (bin/run.conf) settings



-Xms128m

-Xmx512m

-Dsun.rmi.dgc.client.gcInterval=360

-Dsun.rmi.dgc.server.gcInterval=360

-XX:+UseConcMarkSweepGC

-XX:+CMSPermGenSweepingEnabled

-XX:+CMSClassUnloadingEnabled

-XX:MaxPermSize=512m
-Xverify:none



of course these settings would be different for IBM JVM
Martin Gainty
__
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte
Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht
dient lediglich dem Austausch von Informationen und entfaltet keine
rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von
E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.

Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le
destinataire prévu, nous te demandons avec bonté que pour satisfaire
informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie
de ceci est interdite. Ce message sert à l'information seulement et n'aura
pas n'importe quel effet légalement obligatoire. Étant donné que les email
peuvent facilement être sujets à la manipulation, nous ne pouvons accepter
aucune responsabilité pour le contenu fourni.






From: vikram.g.by...@accenture.com
To: user@struts.apache.org
Date: Fri, 9 Jul 2010 13:21:03 +0530
Subject: RE: OutOfMemoryError: PermGen space Dont know why?

-XX:PermSize=64M -XX:MaxPermSize=128M, these parameters define
"PermGenSpace", this is where all class files are loaded.

Check out your Heap memory size. The PermGenSpace should be 1/4th of your
allocated Heap memory.



Best Regards,

Vikram
-Original Message-
From: Brian Thompson [mailto:elephant...@gmail.com]
Sent: Friday, July 09, 2010 1:14 PM
To: Struts Users Mailing List
Subject: Re: OutOfMemoryError: PermGen space Dont know why?

You could also adjust your eclipse.ini to give more memory to the JVM:

-XX:PermSize=64M -XX:MaxPermSize=128M

Add it to the --vmargs section of the file.

-Brian




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



Re: OutOfMemoryError: PermGen space!!!! Dont know why?

2010-07-12 Thread abhishek jain
Hi,
How can i check how much memory is it currently consuming / using.

thanks
abhishek

On Sun, Jul 11, 2010 at 6:34 AM, Martin Gainty  wrote:

>
> sounds as if class and method objects could possibly be missed by GC..try
> this for running under Jboss using Sun JVM (bin/run.conf) settings
>
>
>
> -Xms128m
>
> -Xmx512m
>
> -Dsun.rmi.dgc.client.gcInterval=360
>
> -Dsun.rmi.dgc.server.gcInterval=360
>
> -XX:+UseConcMarkSweepGC
>
> -XX:+CMSPermGenSweepingEnabled
>
> -XX:+CMSClassUnloadingEnabled
>
> -XX:MaxPermSize=512m
> -Xverify:none
>
>
>
> of course these settings would be different for IBM JVM
> Martin Gainty
> __
> Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
>
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
> Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte
> Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht
> dient lediglich dem Austausch von Informationen und entfaltet keine
> rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von
> E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
>
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le
> destinataire prévu, nous te demandons avec bonté que pour satisfaire
> informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie
> de ceci est interdite. Ce message sert à l'information seulement et n'aura
> pas n'importe quel effet légalement obligatoire. Étant donné que les email
> peuvent facilement être sujets à la manipulation, nous ne pouvons accepter
> aucune responsabilité pour le contenu fourni.
>
>
>
>
>
> > From: vikram.g.by...@accenture.com
> > To: user@struts.apache.org
> > Date: Fri, 9 Jul 2010 13:21:03 +0530
> > Subject: RE: OutOfMemoryError: PermGen space Dont know why?
> >
> > -XX:PermSize=64M -XX:MaxPermSize=128M, these parameters define
> > "PermGenSpace", this is where all class files are loaded.
> >
> > Check out your Heap memory size. The PermGenSpace should be 1/4th of your
> > allocated Heap memory.
> >
> >
> >
> > Best Regards,
> >
> > Vikram
> > -Original Message-
> > From: Brian Thompson [mailto:elephant...@gmail.com]
> > Sent: Friday, July 09, 2010 1:14 PM
> > To: Struts Users Mailing List
> > Subject: Re: OutOfMemoryError: PermGen space Dont know why?
> >
> > You could also adjust your eclipse.ini to give more memory to the JVM:
> >
> > -XX:PermSize=64M -XX:MaxPermSize=128M
> >
> > Add it to the --vmargs section of the file.
> >
> > -Brian
> >
>


Re: [S2] post JSON to REST

2010-07-12 Thread Frans Thamura
We use http post

But dunno how to send via json rpc
(m)

-Original Message-
From: mailtolouis2020-str...@yahoo.com
Date: Mon, 12 Jul 2010 07:29:53 
To: Struts Users Mailing List
Reply-To: "Struts Users Mailing List" 
Subject: [S2] post JSON to REST



Hi,



Sorry if this is double posted, because I didn't receive the mail which I post.

I'm new to the struts2 rest plugin, I hope someone can help me.

I'm trying to post a json data to a UserController, I can see create method is 
invoked, but the json data is not set to the UserController.

Here is the json data:
{"user":{"userName":"TestUser","userEmail":"testu...@yahoo.com"}}

In my UserController, I've defined these getter/setter

public void setModel(UserBean bean)
public UserBean getModel()
public void setUser(UserBean bean)
public UserBean getUser()
public void  setUserName(String name)
public String getUserName()
public void setUserEmail(String email)
public String getUserEmail()

From the log, I can c getModel(), validate(), create() are called, but no one 
setting anything to the controller.

Do I need to do extra thing to receive the json data?

The GET is working fine when I want to get some data from the UserController.

I've been searching the net pass 2 days, unfortunately most info are about GET, 
not POST or PUT.

I hope your guys can help me.

THanks
LV


Struts 2 + Spring 2 + JPA + AJAX question

2010-07-12 Thread red phoenix
I want to use Struts 2 + Spring 2 + JPA + AJAX,I find it as following url:
http://struts.apache.org/2.1.8/docs/struts-2-spring-2-jpa-ajax.html

When I try to download this code,like follows:
Get the 
code

   - Show me the
code

I get Page Not found error! Where can I get the code?

Thanks!


[S2] post JSON to REST

2010-07-12 Thread mailtolouis2020-struts


Hi,



Sorry if this is double posted, because I didn't receive the mail which I post.

I'm new to the struts2 rest plugin, I hope someone can help me.

I'm trying to post a json data to a UserController, I can see create method is 
invoked, but the json data is not set to the UserController.

Here is the json data:
{"user":{"userName":"TestUser","userEmail":"testu...@yahoo.com"}}

In my UserController, I've defined these getter/setter

public void setModel(UserBean bean)
public UserBean getModel()
public void setUser(UserBean bean)
public UserBean getUser()
public void  setUserName(String name)
public String getUserName()
public void setUserEmail(String email)
public String getUserEmail()

>From the log, I can c getModel(), validate(), create() are called, but no one 
setting anything to the controller.

Do I need to do extra thing to receive the json data?

The GET is working fine when I want to get some data from the UserController.

I've been searching the net pass 2 days, unfortunately most info are about GET, 
not POST or PUT.

I hope your guys can help me.

THanks
LV

Created a struts2 application but getting odd results

2010-07-12 Thread John L. Longo
Here is the situation:

I'm using two separate browsers (IE8 & FF3.6) to test the application at the 
same time.

I have a form that takes contact information (name, address, email, etc.)

I access the form (http://localhost:9084/demosite/contactus.action) from IE8 
and type the first name and hit the submit button.

The validation fails and the page is displayed with the first Name still filled 
in and the correct error messages displayed (Last Name Required, etc.).

BTW, That's is what I expected.

But here is the odd problem that I'm seeing:

I then open up FF3.6 and enter the URL 
http://localhost:9084/demosite/contactus.action

I see the page displayed with the same info (First Name filled in and error 
messages displayed) that I have in the IE8 browser.

I'm using struts2-core-2.1.8.1 and running it under Websphere 7.0.0.9.

I'm sure I have a setup issue, but really don't know what it could be, other 
than that the application is working fine no error messages in the logs.