Re: Struts 2 + Spring 2 + JPA + AJAX Tutorial

2007-07-17 Thread LucaLuca

Hi,

It was in the right place, but didn't work. So, i've tried to put the
"hilbernate-all.jar" in the build path, and it worked. I don't know the
reason, but probably i was using the latest version of the requested 
libraries and it need something older..

Thank you everybody for the time you spent with me.

LucaLuca




cilquirm wrote:
> 
> By the looks of it, your classpath is messed up.
> 
> Is the hibernate3 jar in the right place?
> 
> I can't think of any other reason it wouldn't be able to find
> org.hibernate.MappingNotFoundException
> 
> 
> 
> LucaLuca wrote:
>> 
>> Hi,
>> 
>> I've tried to make some changes to make it work..But nothing!. These are
>> my configuration files:
>> 
>> ---"ApplicationContext.xml":---
>> 
>> 
>> >  xmlns="http://www.springframework.org/schema/beans";
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>> xmlns:aop="http://www.springframework.org/schema/aop";
>> xmlns:tx="http://www.springframework.org/schema/tx";
>> xsi:schemaLocation="
>> http://www.springframework.org/schema/beans
>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
>> http://www.springframework.org/schema/tx
>> http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
>> http://www.springframework.org/schema/aop
>> http://www.springframework.org/schema/aop/spring-aop-2.0.xsd";>
>> 
>> 
>> > class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor"
>> />  
>>  > class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor"/>
>>   
>>  
>>  
>> 
>>  >
>> class="org.springframework.jdbc.datasource.DriverManagerDataSource">
>> 
>> > value="jdbc:mysql://localhost:3306/quickstart" />
>> 
>> 
>> 
>> 
>> >
>> class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
>>   
>>  
>> > class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
>> 
>>  
>> 
>> 
>> 
>> 
>>   
>> > class="org.springframework.orm.jpa.JpaTransactionManager">
>> > />
>>  
>> 
>> 
>>  
>>  
>> > class="quickstart.action.PersonAction">
>> 
>> 
>> 
>> 
>> 
>> ---"Web.xml"---
>> 
>> 
>> http://java.sun.com/xml/ns/j2ee";
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>> xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
>> http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";>
>> quickstart
>> 
>> struts2
>> 
>> org.apache.struts2.dispatcher.FilterDispatcher
>> 
>> 
>> 
>> 
>> struts2
>> /*
>> 
>> 
>> 
>> 
>> org.springframework.web.context.ContextLoaderListener
>> 
>> 
>> 
>>  
>> index.jsp
>> 
>>  
>> 
>> 
>> 
>> --"Struts.xml"--
>> 
>> 
>> > "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
>> "http://struts.apache.org/dtds/struts-2.0.dtd";>
>> 
>>
>> 
>> 
>> > class="quickstart.action.PersonAction">
>> pages/list.jsp
>> pages/list.jsp
>> 
>> 
>> > method="remove">
>> pages/list.jsp
>> pages/list.jsp
>> 
>> 
>> > method="save">
>> pages/list.jsp
>> pages/list.jsp
>> 
>> 
>> 
>> 
>> 
>> --"Struts.properties"--
>> 
>> struts.objectFactory =
>> org.apache.struts2.spring.StrutsSpringObjectFactory
>> struts.devMode = true
>> struts.enable.DynamicMethodInvocation = false
>> struts.objectFactory.spring.autoWire = type
>> 
>> 
>> ---This is my Stack error trace...:---
>> 
>> 
>> 
>> GRAVE: Context initialization failed
>> org.springframework.beans.factory.BeanCreationException: Error creating
>> bean with name 'entityManagerFactory' defined in ServletContext resource
>> [/WEB-INF/applicationContext.xml]: Invocation of init method failed;
>> nested exception is java.lang.NoClassDefFoundError:
>> org/hibernate/MappingNotFoundException
>> at
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1178)
>> at
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:407)
>> at
>> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:255)
>> at
>> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
>> at
>> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:252)
>> at
>> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
>> at
>> org.springframework.beans.factory.support.DefaultListableBe

problem while developing a DynaValidatiorForm application

2007-07-17 Thread Narasimha Raju Naidu

dear,


i am not getting the parameter values whlie dispalying the errors. i am
providing all my code here can any one help me regarding this



Form Bean class:URformBean.java

java Code:


*import* javax.servlet.http.*;*import*
org.apache.struts.action.*;*import*
org.apache.struts.validator.*;*public* *class* URFormBean *extends*
DynaValidatorForm{*public* *void* reset(ActionMapping
actionMapping,HttpServletRequest req) {
   System.out.println("reset called");
   set("userName","UserName");
   set("passOne","");
  set("passTwo","");
   set("age","");
  set("email","email id");
  System.out.println("reset end");
}}


Action class:URAction.java


java Code:

*import* javax.servlet.http.*;*import*
org.apache.struts.action.*;*public* *class* URAction *extends* Action{
*public* ActionForward execute(ActionMapping actionMapping,ActionForm
form,HttpServletRequest req,HttpServletResponse res)*throws* Exception
 {
 *try*
   {
   URFormBean ufb=(URFormBean)form;
 }
  *catch* (Exception e)
{
  System.out.println("error");
}//System.out.println((String)ufb.get("userName"));
 *return* actionMapping.findForward("ur");
   }}



Form: urform.jsp

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

User Registration Form
 
 User Name:

Password:

Re-password:

 age:

 email:

 
   
  




and
sucess page after sucessfully registered

struts-config.xml


 
 
   

  
   
  

  
 




validation.xml


















var-name>min
25


max
50












all the above are different source code and i am not getting any erors or
exceptions
can any one tell where i am doing mistakes


regards


Re: ******** Java script not working in Netscape,Firefox,Safari*******URGENT PLS HELP ME**********

2007-07-17 Thread csirus

Just a note on the Javascript document properties not found error. I
encountered this when I was trying to handle a div that did not exist in the
html. My script would hide all layers before showing a selected layer, and
one of the layers to be hidden did not actually exist.

-- 
View this message in context: 
http://www.nabble.com/-Java-script-not-working-in-Netscape%2CFirefox%2CSafari***URGENT-PLS-HELP-ME**-tf3943161.html#a11662471
Sent from the Struts - User mailing list archive at Nabble.com.


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



Validation of DynaValidatorForm with String array

2007-07-17 Thread Rahul Joshi
Hi,

In my struts application I am using a DynaValidatorForm which contains a
String[].
I am doing "required", "integer" and "intRange" validation on the form.
The problem I am facing is that if I declare the property in
struts-config.xml as a string array with given size 
(like this : )
then the "required" validation fails, on every form submit which has
less then 264 instances of propName.

For example if form is submitted with only propName[0]=5 &
propName[1]=10 then validation fails for rest of the array.


How can I get the form validatation for only limited size of array, in
this case for only two indexes.

Any suggestion is appreciated.

Thanks
-Rahul


Validation Problem

2007-07-17 Thread alamsz alamsz
Hi All,
   
  I'm new in struts , I have problems with struts validation, my application 
was using struts 1.1 and validator 1.0,,i'm trying to upgrade to struts 1.2.7 
and common validator 1.1.4 because i use non default resource bundle as arg key 
in validation. My problem is when struts generates the javascript function for 
validation , the name of the function always starts with i.e, 
formname_required(). That's problem to my application because sometimes i'm 
using one action form for more than one page, and the validation will be 
generated error. To make it clearer i'll give example 
   
  //the javascript validation created by struts
   var bCancel = false; 
  function validateServiceForm(form) {  
 
if (bCancel) 
  return true; 
else 
 var formValidationResult;
   formValidationResult = validateDate(form); 
 return (formValidationResult == 1);
   } 
  function ServiceForm_DateValidations () { 
 this.a0 = new Array("schedDate", "'Date' is not in a valid date format.", 
new Function ("varName", "this.datePattern='d-M-';  return 
this[varName];"));
} 
   
  //my form name
  
   
  so it will generate error because the javascript validation will called 
ServiceSearchForm_DateValidations instead of ServiceForm_DateValidations 
   
  In struts 1.1 the function generated will be 
  function DateValidations () { 
 this.a0 = new Array("schedDate", "'Date' is not in a valid date format.", 
new Function ("varName", "this.datePattern='d-M-';  return 
this[varName];"));
} 
  without formname, so it is not a problem for the old validation.
  If any one could help / give some advice regarding this matter that would be 
great.
   
  thanks , 
  Adi

   
-
Get the Yahoo! toolbar and be alerted to new email wherever you're surfing. 

[SOLVED] Re: [S2] Disable fileupload interceptor

2007-07-17 Thread Oguz Kologlu

I think the simplest way is to copy

org.apache.struts2.dispatcher.multipart.MultiPartRequestWrapper

to your classpath and change the

MultiPartRequestWrapper(..)

method to ignore the content.

I've put in a enhancement request in jira for a configuration item to  
disable Multipart request parsing - we'll see what happens.


HTH anyone in the same boat
Oz


On 16/07/2007, at 2:06 PM, Oguz Kologlu wrote:


Hi all,

I've a S1/S2 mixed application that uses a S1 action to upload  
files, however S2 keeps getting in the way and ripping out the  
uploaded data even though it is a S1 action being called.


Is there a way to disable the file upload interceptor so the S1  
action can handle the upload? Or at least access the value stack  
from S1 to retrieve the file?


Thanks
Oz



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





Re: Display Tag Help

2007-07-17 Thread Peng Tuck Kwok

There's a in depth tutorial somewhere on the displaytag home page & some
examples that you can play around with.
http://displaytag.sourceforge.net/11/

On 7/18/07, naseer mohammed <[EMAIL PROTECTED]> wrote:


Can any one explain me step by step method to use display tags



Display Tag Help

2007-07-17 Thread naseer mohammed

Can any one explain me step by step method to use display tags


Re: error

2007-07-17 Thread naseer mohammed

yes i used jdk only as java_home but still it does'nt work.

On 7/17/07, Perssy Llamosas <[EMAIL PROTECTED]> wrote:


Use a JDK, not a JRE as JAVA_HOME.

naseer mohammed wrote:
> i am trying to run struts-blank application which encounter this
> exception..
>
>
> org.apache.jasper.JasperException: No Java compiler available
> org.apache.jasper.servlet.JspServletWrapper.handleJspException(
JspServletWrapper.java:510)
>
> org.apache.jasper.servlet.JspServletWrapper.service(
JspServletWrapper.java:387)
>
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java
:314)
>
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>
>
>
> help me solve this problem
>


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




Re: Displaytag help in Struts 2

2007-07-17 Thread Jeromy Evans
Yes, I use it as stated previously.  Is row the object you think it is?  
You either have a typo or you're trying to access properties of row that 
don't exist.


The code below shows plain html contained in a column that accesses 
properties of the current row.



 


property="dateCreated" decorator="xxx.decorators.ShortDateDecorator"/>


View ">

 
  


* note there are better ways to generate an anchor in a displaytag 
table.  This is demonstrating how to access the current row using 
struts2 tags.


kishanparikh wrote:

Hello,

Were you able to get the "row" to work? I am trying to get hold of the my
properties using the "row" variable inside of a displaytag table. The table
itself if working fine.

I have tried both the JSTL and the OGNL way but the "row" is always empty.

Does anyone know how to get this working for Struts2? Any help is
appreciated.

Thank you.

- Kishan

Jeromy Evans - Blue Sky Minds wrote:
  


Within the displaytag 'display:table' tag, a 'row' object is set into
the page context.
How is this accessible from Struts 2?
  
#attr is the  OGNL to access the page context.#attr.row will access 
your display tag id object named row


eg. #1

   


eg. #2


 
  

#attr is described here:
http://struts.apache.org/2.x/docs/ognl.html

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






  



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



[S2] Struts-JSF Plugin

2007-07-17 Thread Ray Clough

We are trying to use the Struts-JSF plugin, and are encountering problems.
1.  The rendered form has the wrong 'action' attribute.  We want it to be
"TableTest.action", and the component renders it as "TableTest.jsf".  We
were able to overcome this with a javascript at the end of the page to
change the form's 'action'.  
2.  Using the Tomahawk "Extended Data Table" component, the table renders
properly, but the sorting is not working.  The 'TableTestAction' class has a
method 'setSortKey()', which is called when we click the column header, but
the property is always "_id0", even when clicking the "_id1" column.  Thus
the table is always sorted on Column-0.

Does anyone have insight into this problem?

- Ray Clough

-- 
View this message in context: 
http://www.nabble.com/-S2--Struts-JSF-Plugin-tf4100325.html#a11660398
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: Does Tiles Layout page can have struts form components

2007-07-17 Thread Arunkumar Balasubramanian
Hi
 
 Thanks for your response.
 
 Could you please elaborate on this. I read your message and was trying to 
extract the information from it. If you could elaborate it, It will be of great 
help.
 
 Once again thanks for your response.
 
 Regards,
 Arun
 



> Date: Tue, 17 Jul 2007 09:13:45 +0200> From: [EMAIL PROTECTED]> To: 
> user@struts.apache.org> Subject: Re: Does Tiles Layout page can have struts 
> form components> > 2007/7/17, Arunkumar Balasubramanian <[EMAIL PROTECTED]>:> 
> >> >> >  href="javascript:newWindow_sepatate_fields(document.editAddress.monthMM,> > 
> document.editAddress.dateDD, document.editAddress.year)"> > 
> onkeydown="showFieldHelp(HELP_DATE_CALENDAR)"> > >> > The calender icon on pagetwo.jsp 
> is> >> >  href="javascript:newWindow_sepatate_fields(document.Addresspage.monthMM,> > 
> document.Addresspage.dateDD, document.Addresspage.year)"> > 
> onkeydown="showFieldHelp(HELP_DATE_CALENDAR)"> > > > > > You could use a "controller" 
> (in the Tiles sense) for the definition that> stores an extra attribute (for 
> example, the javascript command) and then> import it (via 
> ) and put it in your "href" attribute.> > Antonio
_
Missed the show?  Watch videos of the Live Earth Concert on MSN.
http://liveearth.msn.com

How can I tell Struts 2 to throw/log exceptions for invalid OGNL Expressions

2007-07-17 Thread mraible

I have the following class:

public class TestAction {

public static String concat(String str1, String str2) {
return str1 + " and " + str2;
}
}

In a JSP, I can write the following and it works fine:



However, if I change it to an invalid class name, it fails silently:



I've tried turning up the logging for org.apache.struts2,
com.opensymphony.xwork2 and ognl - but it still fails silently. Any ideas
how to get better error messages about invalid OGNL expressions?

Thanks,

Matt
-- 
View this message in context: 
http://www.nabble.com/How-can-I-tell-Struts-2-to-throw-log-exceptions-for-invalid-OGNL-Expressions-tf4100102.html#a11659700
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: S2: Getting info from server via topic

2007-07-17 Thread Musachy Barroso

Anything that you write to the output stream on your action will be
available on the "data" argument.

musachy

On 7/17/07, Scott Nesbitt <[EMAIL PROTECTED]> wrote:



For this topic:

dojo.event.topic.subscribe("/saveTopic",
function(data, type, e)
{
// data : text returned
// type : "before", "load" or "error"
// e: request object
  if ('load' == type)
  {

  }
}

When my action on the server is successful the type is
set to load and things work great.  However, I would
like to send some data back from the server also (in
the "data" arg, I presume.)

I posted this a week ago but got no response.  Is this
better asked in the Dojo list?

Thanks,

Scott



  

Park yourself in front of a world of choices in alternative vehicles.
Visit the Yahoo! Auto Green Center.
http://autos.yahoo.com/green_center/

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





--
"Hey you! Would you help me to carry the stone?" Pink Floyd


S2: Getting info from server via topic

2007-07-17 Thread Scott Nesbitt

For this topic:

dojo.event.topic.subscribe("/saveTopic",
function(data, type, e)
{
// data : text returned
// type : "before", "load" or "error"
// e: request object
  if ('load' == type)
  {

  }
}

When my action on the server is successful the type is
set to load and things work great.  However, I would
like to send some data back from the server also (in
the "data" arg, I presume.)

I posted this a week ago but got no response.  Is this
better asked in the Dojo list?

Thanks,

Scott


  

Park yourself in front of a world of choices in alternative vehicles. Visit the 
Yahoo! Auto Green Center.
http://autos.yahoo.com/green_center/ 

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



Re: Struts 2 + Spring 2 + JPA + AJAX Tutorial

2007-07-17 Thread cilquirm

By the looks of it, your classpath is messed up.

Is the hibernate3 jar in the right place?

I can't think of any other reason it wouldn't be able to find
org.hibernate.MappingNotFoundException



LucaLuca wrote:
> 
> Hi,
> 
> I've tried to make some changes to make it work..But nothing!. These are
> my configuration files:
> 
> ---"ApplicationContext.xml":---
> 
> 
>xmlns="http://www.springframework.org/schema/beans";
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> xmlns:aop="http://www.springframework.org/schema/aop";
> xmlns:tx="http://www.springframework.org/schema/tx";
> xsi:schemaLocation="
> http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
> http://www.springframework.org/schema/tx
> http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
> http://www.springframework.org/schema/aop
> http://www.springframework.org/schema/aop/spring-aop-2.0.xsd";>
> 
> 
>  class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor"
> />  
>class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor"/>
>   
>   
>   
>  
>   
> class="org.springframework.jdbc.datasource.DriverManagerDataSource">
> 
>  value="jdbc:mysql://localhost:3306/quickstart" />
> 
> 
> 
> 
> 
> class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
>
>   
>  class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"> 
>
>   
> 
> 
> 
> 
>   
>  class="org.springframework.orm.jpa.JpaTransactionManager">
>  />
>   
> 
> 
>   
>   
>  class="quickstart.action.PersonAction">
> 
> 
> 
> 
> 
> ---"Web.xml"---
> 
> 
> http://java.sun.com/xml/ns/j2ee";
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
> http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";>
> quickstart
> 
> struts2
> 
> org.apache.struts2.dispatcher.FilterDispatcher
> 
> 
> 
> 
> struts2
> /*
> 
> 
> 
> 
> org.springframework.web.context.ContextLoaderListener
> 
> 
> 
>  
> index.jsp
> 
>  
> 
> 
> 
> --"Struts.xml"--
> 
> 
>  "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
> "http://struts.apache.org/dtds/struts-2.0.dtd";>
> 
>
> 
> 
>  class="quickstart.action.PersonAction">
> pages/list.jsp
> pages/list.jsp
> 
> 
>  method="remove">
> pages/list.jsp
> pages/list.jsp
> 
> 
>  method="save">
> pages/list.jsp
> pages/list.jsp
> 
> 
> 
> 
> 
> --"Struts.properties"--
> 
> struts.objectFactory = org.apache.struts2.spring.StrutsSpringObjectFactory
> struts.devMode = true
> struts.enable.DynamicMethodInvocation = false
> struts.objectFactory.spring.autoWire = type
> 
> 
> ---This is my Stack error trace...:---
> 
> 
> 
> GRAVE: Context initialization failed
> org.springframework.beans.factory.BeanCreationException: Error creating
> bean with name 'entityManagerFactory' defined in ServletContext resource
> [/WEB-INF/applicationContext.xml]: Invocation of init method failed;
> nested exception is java.lang.NoClassDefFoundError:
> org/hibernate/MappingNotFoundException
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1178)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:407)
> at
> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:255)
> at
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
> at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:252)
> at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
> at
> org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:247)
> at
> org.springframework.beans.factory.BeanFactoryUtils.beansOfTypeIncludingAncestors(BeanFactoryUtils.java:257)
> at
> org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.detectPersistenceExceptionTranslators(PersistenceExceptionTranslationInterceptor.java:121)
> at
> org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.(PersistenceExceptionTranslationInterceptor.java:77)
> at
> org.springframework.dao.annotation.Per

RE: [S2] TabbedPanel with Remote DIVs

2007-07-17 Thread Hoying, Ken
I must have had my syntax wrong or something else before.  It is working
for me now.  Thank you for the follow up. 

Take care,
Ken
-Original Message-
From: Musachy Barroso [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 17, 2007 11:45 AM
To: Struts Users Mailing List
Subject: Re: [S2] TabbedPanel with Remote DIVs

Using any tool like firebug, and building the url with the "url" tag, do
you see the parameters in the request?

musachy

On 7/16/07, Hoying, Ken <[EMAIL PROTECTED]> wrote:
>
> I have a tabbed panel with divs that retrieve their content remotely.
> Basically the control is acting like a tabbed address book with each 
> tab showing a subset of names broken out alphabetically (i.e. Tabs: 
> A-B, C-D, etc..)
>
> When specifying the URL for the remote div to call, I am having 
> difficulty determining how to pass in my parameter (i.e.
> ?startLetter=A&endLetter=B).  I tried to use an s:url tag with 
> parameters and pass it to the div via its id. However, this is not 
> working.  It appears that the DIV is ignoring the parameters.  The 
> only way that I have been able to get this to work is to create a 
> dummy form for each tab which contains fields with the desired param 
> names and values and then reference the form in each tab.
>
> This is obviously a very ugly implementation as it results in a lot of

> unneeded forms whose sole purpose is for the div remote calls.  I am 
> new to tabbedPanels and remote div calls and am certain I am missing 
> something here.  Can anyone perhaps enlighten me with a better
solution?
>
> Thanks in advance,
> Ken
>
>
>
> -
> ***Note:The information contained in this message may be privileged 
> and confidential and protected from disclosure. If the reader of this 
> message is not the intended recipient, or an employee or agent 
> responsible for delivering this message to the intended recipient, you

> are hereby notified that any dissemination, distribution or copying of

> this communication is strictly prohibited. If you have received this 
> communication in error, please notify the Sender immediately by 
> replying to the message and deleting it from your computer. Thank you.

> Premier Inc.




--
"Hey you! Would you help me to carry the stone?" Pink Floyd

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



Re: slowing down action execution time

2007-07-17 Thread Leon Rosenberg

We actually didnt provide you any solution, but its pretty hard, since
you haven't provided any details :-)

There are many possibilities, IP-Throttle, session-based throttle or a
mechanism which manages the overall load on the server. Without
knowing what you are doing, providing even a hint is pretty hard.

regards
Leon

On 7/17/07, Ing. Andrea Vettori <[EMAIL PROTECTED]> wrote:

thanks to all

I'll try...


Il giorno 17/lug/07, alle ore 16:38, Antonio Petrelli ha scritto:

> 2007/7/17, Ing. Andrea Vettori <[EMAIL PROTECTED]>:
>> I don't remember where but I think I read somewhere that's not
>> possibile to call Thread methods inside a servlet container.
>>
>> Anyone can confirm this ?
>
>
> AFAIK you cannot create any thread in a Java EE environment (though
> products like Quartz do this very elegantly), but I think that you can
> do anything with your *current* thread.
>
> Antonio
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>

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



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




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



Re: slowing down action execution time

2007-07-17 Thread Leon Rosenberg

I think you misunderstand things a bit here (or maybe the spec wasnt
clear, as often)

servlet spec 2.5 (the current one, and the one tomcat 6 is
implementing) states in
SRV.14.2.2 Web Application Environment (9.11 now merily point to this chapter):

"Java EE defines a naming environment that allows applications to easily access
resources and external information without explicit knowledge of how
the external
information is named or organized."
...

"This type of servlet container must support lookups of such objects and
calls made to those objects when performed on a thread managed by the servlet
container. This type of servlet container should support this behavior when
performed on threads created by the developer, but are not currently
required to do
so. Such a requirement will be added in the next version of this specification.
Developers are cautioned that depending on this capability for
application-created
threads is not recommended, as it is non-portable."

So the distinction between application-created and container-created
thread is that application created thread may not have the ability to
access container managed resources (ejb related stuff, something 90%
of us will never need (*thankfully*)) but the servlet containers will
have to support it in next version (which I assume is 3.0 and is
scheduled to the end of 2008, so effectively 2009). The ability to
access such resources from custom threads is not portable. The threads
themself are absolutely portable.
I also doubt that its possible to prevent an application from thread
creation, maybe by some obscure security manager settings, but i doubt
it, since it will probably break 90% of existing 3 tier webapps.

Without the ability to create threads you won't be able to communicate
via corba or rmi or do anything useful in your webapp ;-)

regards
Leon




On 7/17/07, Antonio Petrelli <[EMAIL PROTECTED]> wrote:

2007/7/17, Leon Rosenberg <[EMAIL PROTECTED]>:
>
> you can create threads in tomcat. It's not recommended unless you know
> what you are doing, but you can.
>


It seems that you are right... and not :-)
You can create threads in a servlet container, but it is not portable.
As stated in Servlet 2.4 specification, section SRV.9.11:


This type ofservlet container should support this behavior when performed on
threads created by the
developer, but are not currently required to do so. Such a requirement will
be
added in the next version of this specification.  Developers are cautioned
that
depending on this capability for application-created threads is not
recommended,
as it is non-portable.


Antonio



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



Struts2 StrutsTestCase

2007-07-17 Thread bartlebooth

Hello,

I'm fairly new to Struts 2. I'm currently migrating a project from 
Struts 1 to Struts 2, but I'd like to make heavy use of Unit Testing to 
aid in the migration.
In the documentation, the testability of the new actions is often 
mentioned. However, I have the impression that it's not that simple at all.


I put some work into using the StrutsTestCase class as base class for my 
tests, but I've run into some problems that I can't really understand.


1. There is hardly any documentation regarding the StrutsTestCase or the 
XWorkTestCase base classes. Not in the documentation, not in the mail 
archives, not even the issue tracker. Is anyone using these classes at all ?
I've found a short part in Ian Roughley's book Starting Struts 2, but 
the example did not work for me.


2. I did found some examples in the struts2-showcase web application, 
and building upon these, I succeeded in setting up my test cases.
I have my base class, with the setup of request and session objects, the 
code of which is shown below (picked from the 
ExecuteAndWaitInterceptorTest class in the showcase source code).


public abstract class BaseTestCase extends StrutsTestCase {

   protected StrutsMockHttpServletRequest request;
   protected HttpSession httpSession;
   protected Map context;
   protected Map params;
   protected Map session;
   protected ServletContext servletContext;
  
   protected void setUp() throws Exception {

   //super.setUp();  <- Does not work !

   loadConfigurationProviders(new LocationConfigurationProvider());
  
   session = new HashMap();

   params = new HashMap();
   context = new HashMap();
   context.put(ActionContext.SESSION, session);
   context.put(ActionContext.PARAMETERS, params);

   request = new StrutsMockHttpServletRequest();
   request.setParameterMap(params);
   context.put(ServletActionContext.HTTP_REQUEST, request);
  
   servletContext = new MockServletContext();
   servletContext.setAttribute(DaoPlugIn.DAOMANAGER, 
DaoConfig.getDaoManager());

   context.put(ServletActionContext.SERVLET_CONTEXT, servletContext);
  
   UserInfo userInfo = ..

   ...
   session.put(AppConstants.APP_USER_INFO_KEY, userInfo);
   }

   // can be overridden by subclasses
   public List getInterceptors() {
   List interceptors = new 
ArrayList();
   interceptors.add(new InterceptorMapping("servlet", new 
ServletConfigInterceptor()));
   interceptors.add(new InterceptorMapping("params", new 
ParametersInterceptor()));
   interceptors.add(new InterceptorMapping("prepare", new 
PrepareInterceptor()));
   interceptors.add(new InterceptorMapping("params", new 
ParametersInterceptor()));
  
   return interceptors;

   }
  
   // can be overridden by subclasses

   public Map getResultConfig() {
   Map results = new HashMapResultConfig>();
   results.put(Action.SUCCESS, new ResultConfig(Action.SUCCESS, 
MockResult.class.getName(), null));
  
   return results;

   }

   // every test class will test a particular action class
   public abstract Class getActionClass();

   // add package configurations, containing action names, method 
names, ...
   // this is specific for each test class, so here's only an abstract 
method

   public abstract void getPackageConfigs(Configuration configuration);
  

   private class LocationConfigurationProvider implements 
ConfigurationProvider {


   Configuration configuration;
   public void destroy() {
   //waitInterceptor.destroy();
   }

   public boolean needsReload() {
   return false;
   }

   public void init(Configuration configuration) throws 
ConfigurationException {

   this.configuration = configuration;
   }

   public void loadPackages() throws ConfigurationException {
  getPackageConfigs(configuration);
   }

   public void register(ContainerBuilder builder, 
LocatableProperties props) throws ConfigurationException {

   builder.factory(ObjectFactory.class);
   builder.factory(ActionProxyFactory.class, 
DefaultActionProxyFactory.class);

   }
   }
}

The problem I've found is that it is not possible to execute
super.setUp()

When adding or uncommenting this line, I get an error

17 Jul 2007 18:42:01,589 - FATAL 
org.apache.struts2.spring.StrutsSpringObjectFactory - ** FATAL 
ERROR STARTING UP SPRING-STRUTS INTEGRATION **

Looks like the Spring listener was not configured for your web app!
Nothing will work until WebApplicationContextUtils returns a valid 
ApplicationContext.

You might need to add the following to web.xml:
   
   
org.springframework.web.context.ContextLoaderListener

   

The Spring listener IS configured in my web.xml, but it seems that the 
test case cannot find the web.xml file itself, even though I put the 
WEB-INF directory, and the directory containing the WEB-INF directory in 
the classp

Re: how do I get latest version of xwork library or struts 2.0.8

2007-07-17 Thread Guillaume Carré

2007/7/17, David Harland <[EMAIL PROTECTED]>:

Hi,

As recommended in

http://cwiki.apache.org/confluence/display/WW/S2-001

I tried downloading and building the latest version of struts but
instead of getting 2.0.8 I got 2.1.
I then tried to get the latest version xwork and build that, and that
had 3 errors.

Can someone please give me a link to a binary of either of them,
whichever is the better option, please.


http://struts.apache.org/download.cgi
--
Guillaume Carré

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



how do I get latest version of xwork library or struts 2.0.8

2007-07-17 Thread David Harland
Hi,

As recommended in

http://cwiki.apache.org/confluence/display/WW/S2-001

I tried downloading and building the latest version of struts but
instead of getting 2.0.8 I got 2.1. 
I then tried to get the latest version xwork and build that, and that
had 3 errors.

Can someone please give me a link to a binary of either of them,
whichever is the better option, please.

Many Thanks

Dave.

__
Ufi Limited 
Registered in England No.  3980770 
Registered Office:  Dearing House, 1 Young Street, Sheffield, S1 4UP 

learndirect Solutions Ltd 
Registered in England No. 5081669 
Registered Office:  Dearing House, 1 Young Street, Sheffield, S1 4UP 

UFI Charitable Trust 
Registered in England No.  3658378 
Registered Charity No.  1081028 
Registered Office:  Dearing House, 1 Young Street, Sheffield, S1 4UP 

This email has been scanned by the MessageLabs Email Security System.

__

Re: [S2] TabbedPanel with Remote DIVs

2007-07-17 Thread Musachy Barroso

Using any tool like firebug, and building the url with the "url" tag, do you
see the parameters in the request?

musachy

On 7/16/07, Hoying, Ken <[EMAIL PROTECTED]> wrote:


I have a tabbed panel with divs that retrieve their content remotely.
Basically the control is acting like a tabbed address book with each tab
showing a subset of names broken out alphabetically (i.e. Tabs: A-B,
C-D, etc..)

When specifying the URL for the remote div to call, I am having
difficulty determining how to pass in my parameter (i.e.
?startLetter=A&endLetter=B).  I tried to use an s:url tag with
parameters and pass it to the div via its id. However, this is not
working.  It appears that the DIV is ignoring the parameters.  The only
way that I have been able to get this to work is to create a dummy form
for each tab which contains fields with the desired param names and
values and then reference the form in each tab.

This is obviously a very ugly implementation as it results in a lot of
unneeded forms whose sole purpose is for the div remote calls.  I am new
to tabbedPanels and remote div calls and am certain I am missing
something here.  Can anyone perhaps enlighten me with a better solution?

Thanks in advance,
Ken



-
***Note:The information contained in this message may be privileged
and confidential and protected from disclosure. If the reader of
this message is not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient,
you are hereby notified that any dissemination, distribution or
copying of this communication is strictly prohibited. If you have
received this communication in error, please notify the Sender
immediately by replying to the message and deleting it from your
computer. Thank you. Premier Inc.





--
"Hey you! Would you help me to carry the stone?" Pink Floyd


RE: slowing down action execution time

2007-07-17 Thread Al Sutton
You could always use a holder page and a meta refresh.

For example;

Page 1 - Has the form on which the details are entered
| 
[submits to]
|
Action A which stores the details of the query
|
[forwards to]
|
Page 2 which has a meta refresh
(http://webdesign.about.com/od/metataglibraries/a/aa080300a.htm)
|
[refresh redirects to]
|
Action B which gets the results of the query
|
[forwards to]
|
Page 3 which displays the results.


You can then do two things;

1) Increase the meta refresh time in Page 2 to slow down requests.
2) Store the delay in the users session in Action A and if Action B is
called before the delay has completed you redirect the user to Page 2
instead of Page 3.


Hope this is useful,

Al.
-Original Message-
From: Ing. Andrea Vettori [mailto:[EMAIL PROTECTED] 
Sent: 17 July 2007 15:28
To: Struts Users Mailing List
Subject: Re: slowing down action execution time


I need to initially slow down and after a few minutes completely  
block access to aa site to logged-users and/or remote ip addresses  
that reads too many pages too fast.

It's something like controlling that the site is not mirrored.

I don't remember where but I think I read somewhere that's not  
possibile to call Thread methods inside a servlet container.

Anyone can confirm this ?

Thanks

Il giorno 17/lug/07, alle ore 16:25, Leon Rosenberg ha scritto:

> actually you named it.
> Thread.sleep().
>
> only for debugging purposes of course :-)
> regards
> leon
>
> On 7/17/07, Ing. Andrea Vettori <[EMAIL PROTECTED]> wrote:
>> Hi
>>
>> what's the best method to slow an action execution time ? Something 
>> like Thread.sleep(...).
>>
>> Thanks !
>>
>> --
>> Ing. Andrea Vettori
>> Consulente per l'Information Technology
>>
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>

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



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



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



Re: slowing down action execution time

2007-07-17 Thread Ing. Andrea Vettori

thanks to all

I'll try...


Il giorno 17/lug/07, alle ore 16:38, Antonio Petrelli ha scritto:


2007/7/17, Ing. Andrea Vettori <[EMAIL PROTECTED]>:

I don't remember where but I think I read somewhere that's not
possibile to call Thread methods inside a servlet container.

Anyone can confirm this ?



AFAIK you cannot create any thread in a Java EE environment (though
products like Quartz do this very elegantly), but I think that you can
do anything with your *current* thread.

Antonio

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



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



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



Re: slowing down action execution time

2007-07-17 Thread Antonio Petrelli

2007/7/17, Leon Rosenberg <[EMAIL PROTECTED]>:


you can create threads in tomcat. It's not recommended unless you know
what you are doing, but you can.




It seems that you are right... and not :-)
You can create threads in a servlet container, but it is not portable.
As stated in Servlet 2.4 specification, section SRV.9.11:


This type ofservlet container should support this behavior when performed on
threads created by the
developer, but are not currently required to do so. Such a requirement will
be
added in the next version of this specification.  Developers are cautioned
that
depending on this capability for application-created threads is not
recommended,
as it is non-portable.


Antonio


Re: slowing down action execution time

2007-07-17 Thread Leon Rosenberg

On 7/17/07, Antonio Petrelli <[EMAIL PROTECTED]> wrote:

2007/7/17, Ing. Andrea Vettori <[EMAIL PROTECTED]>:
> I don't remember where but I think I read somewhere that's not
> possibile to call Thread methods inside a servlet container.
>
> Anyone can confirm this ?


AFAIK you cannot create any thread in a Java EE environment (though
products like Quartz do this very elegantly), but I think that you can
do anything with your *current* thread.


you can create threads in tomcat. It's not recommended unless you know
what you are doing, but you can.
regards
Leon


Antonio

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




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



[S2] TabbedPanel with Remote DIVs

2007-07-17 Thread Hoying, Ken
 
I have a tabbed panel with divs that retrieve their content remotely.
Basically the control is acting like a tabbed address book with each tab
showing a subset of names broken out alphabetically (i.e. Tabs: A-B,
C-D, etc..)  

When specifying the URL for the remote div to call, I am having
difficulty determining how to pass in my parameter (i.e.
?startLetter=A&endLetter=B).  I tried to use an s:url tag with
parameters and pass it to the div via its id. However, this is not
working.  It appears that the DIV is ignoring the parameters.  The only
way that I have been able to get this to work is to create a dummy form
for each tab which contains fields with the desired param names and
values and then reference the form in each tab.  

This is obviously a very ugly implementation as it results in a lot of
unneeded forms whose sole purpose is for the div remote calls.  I am new
to tabbedPanels and remote div calls and am certain I am missing
something here.  Can anyone perhaps enlighten me with a better solution?

Thanks in advance,
Ken

-
***Note:The information contained in this message may be privileged
and confidential and protected from disclosure. If the reader of
this message is not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient,
you are hereby notified that any dissemination, distribution or
copying of this communication is strictly prohibited. If you have
received this communication in error, please notify the Sender
immediately by replying to the message and deleting it from your
computer. Thank you. Premier Inc.

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



Re: [OT] Re: slowing down action execution time [Friday]

2007-07-17 Thread Leon Rosenberg

On 7/17/07, Antonio Petrelli <[EMAIL PROTECTED]> wrote:

2007/7/17, Wesley Wannemacher <[EMAIL PROTECTED]>:
>
> I've found the most effective way to slow down the execution time is ask
> an intern to "optimize" it...



Hey it's not friday, you broke the rule! ;-)


yeah, but it was funny :-)



Antonio



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



[OT] Re: slowing down action execution time [Friday]

2007-07-17 Thread Antonio Petrelli

2007/7/17, Wesley Wannemacher <[EMAIL PROTECTED]>:


I've found the most effective way to slow down the execution time is ask
an intern to "optimize" it...




Hey it's not friday, you broke the rule! ;-)

Antonio


Re: error

2007-07-17 Thread Perssy Llamosas

Use a JDK, not a JRE as JAVA_HOME.

naseer mohammed wrote:
i am trying to run struts-blank application which encounter this 
exception..



org.apache.jasper.JasperException: No Java compiler available
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510) 

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:387) 

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) 


org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)



help me solve this problem




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



RE: slowing down action execution time [Friday]

2007-07-17 Thread Wesley Wannemacher
I've found the most effective way to slow down the execution time is ask
an intern to "optimize" it...


/zing 

-Original Message-
From: Antonio Petrelli [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 17, 2007 10:38 AM
To: Struts Users Mailing List
Subject: Re: slowing down action execution time

2007/7/17, Ing. Andrea Vettori <[EMAIL PROTECTED]>:
> I don't remember where but I think I read somewhere that's not 
> possibile to call Thread methods inside a servlet container.
>
> Anyone can confirm this ?


AFAIK you cannot create any thread in a Java EE environment (though
products like Quartz do this very elegantly), but I think that you can
do anything with your *current* thread.

Antonio

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


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



Re: autocompleter works at firefox but broken at IE 6

2007-07-17 Thread NHSoft.YHW

deploy showcase apps at tomcat 5.5.17 & JDK1.5.11, when I test "Link two
autocompleter elements" example, when click "Autocompleter 2", the same
error found at IE 6(Firefox works)

but I found follow URL works with IE 6: 
http://www.planetstruts.org/struts2-showcase/ajax/autocompleter/

:(

My Env Detail:
windows 2000 server + tomcat 5.5.17+jdk1.5.11+struts 2.0.8

thanks
-- 
View this message in context: 
http://www.nabble.com/autocompleter-works-at-firefox-but-broken-at-IE-6-tf4097298.html#a11650710
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: slowing down action execution time

2007-07-17 Thread Antonio Petrelli

2007/7/17, Ing. Andrea Vettori <[EMAIL PROTECTED]>:

I don't remember where but I think I read somewhere that's not
possibile to call Thread methods inside a servlet container.

Anyone can confirm this ?



AFAIK you cannot create any thread in a Java EE environment (though
products like Quartz do this very elegantly), but I think that you can
do anything with your *current* thread.

Antonio

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



autocompleter works at firefox but broken at IE 6

2007-07-17 Thread NHSoft.YHW

the code detail:
JSP File :
 

action config:

/ajax/regions.ftl


regions.ftl:
[
<#list regions as region>
["${region.regionName}","${region.regionNum}"],

]


when I test code using firefox, it works; but when change to IE 6, when I
selected first autocompleter arrow, the IE show Error Message:
---
Error
---
Runtime Error

Rows: 4871
Error: [object Error]
---
when i debug in, I found it looks dojo.js has a error,but i do not know how
to solved the problem.

thanks
-- 
View this message in context: 
http://www.nabble.com/autocompleter-works-at-firefox-but-broken-at-IE-6-tf4097298.html#a11650706
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: slowing down action execution time

2007-07-17 Thread Ing. Andrea Vettori
I need to initially slow down and after a few minutes completely  
block access to aa site to logged-users and/or remote ip addresses  
that reads too many pages too fast.


It's something like controlling that the site is not mirrored.

I don't remember where but I think I read somewhere that's not  
possibile to call Thread methods inside a servlet container.


Anyone can confirm this ?

Thanks

Il giorno 17/lug/07, alle ore 16:25, Leon Rosenberg ha scritto:


actually you named it.
Thread.sleep().

only for debugging purposes of course :-)
regards
leon

On 7/17/07, Ing. Andrea Vettori <[EMAIL PROTECTED]> wrote:

Hi

what's the best method to slow an action execution time ? Something
like Thread.sleep(...).

Thanks !

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



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




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



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



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



Re: slowing down action execution time

2007-07-17 Thread Leon Rosenberg

actually you named it.
Thread.sleep().

only for debugging purposes of course :-)
regards
leon

On 7/17/07, Ing. Andrea Vettori <[EMAIL PROTECTED]> wrote:

Hi

what's the best method to slow an action execution time ? Something
like Thread.sleep(...).

Thanks !

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



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




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



slowing down action execution time

2007-07-17 Thread Ing. Andrea Vettori

Hi

what's the best method to slow an action execution time ? Something  
like Thread.sleep(...).


Thanks !

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



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



Re: Displaytag help in Struts 2

2007-07-17 Thread kishanparikh

Hello,

Were you able to get the "row" to work? I am trying to get hold of the my
properties using the "row" variable inside of a displaytag table. The table
itself if working fine.

I have tried both the JSTL and the OGNL way but the "row" is always empty.

Does anyone know how to get this working for Struts2? Any help is
appreciated.

Thank you.

- Kishan

Jeromy Evans - Blue Sky Minds wrote:
> 
> 
>> Within the displaytag 'display:table' tag, a 'row' object is set into
>> the page context.
>> How is this accessible from Struts 2?
> #attr is the  OGNL to access the page context.#attr.row will access 
> your display tag id object named row
> 
> eg. #1
> 
>  
> 
> 
> eg. #2
> 
> 
>  
>   
> 
> #attr is described here:
> http://struts.apache.org/2.x/docs/ognl.html
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Displaytag-help-in-Struts-2-tf4028889.html#a11650054
Sent from the Struts - User mailing list archive at Nabble.com.


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



RV: Struts 2 Theme that doesn't generate extra HTML

2007-07-17 Thread Néstor Boscán
Yes, I find S2 to be a good framework and a good evolution from S1, but the
tags themes instead of helping me are just making things more difficult. I
would also like to use JSTL and JSP but my project requires this tags and
OGNL.

Regards,

Néstor Boscán 

-Mensaje original-
De: Ray Clough [mailto:[EMAIL PROTECTED] Enviado el: Lunes, 16 de Julio
de 2007 08:12 p.m.
Para: Struts Users Mailing List
Asunto: Re: Struts 2 Theme that doesn't generate extra HTML

I always try to use JSTL and JSP-EL when I can, but there used to be bugs in
the process of getting the JSTL tags to work with the value stack.  Are
those problems fixed in 2.0.8?. 

Then there is the question of Ajax in S2.  Completely abandoning the S2 tags
will require using Ajax from an independent source, since the S2 tags are
all tied into Dojo.  

What would be nice is a "zero-config" theme which just renders the basic
html tags, provides access to the value stack, and element-specific error
messages, and doesn't prevent using our own css and styles.  That really
irks me with the S2 tags - sometimes they won't let you specify your own
styles.

The 'themes' problem is one of the core twitches in S2 which I find more
than irritating.  I don't claim to have looked into the architecture of the
implementation, but if I follow the discussion correctly, all pages go thru
freemarker.  The inclusion of features which cannot be escaped, and which
rely on other packages which are largely black boxes makes an app developed
in S2 fragile.  As a developer, I have enough on my plate learning S2
without having to learn freemarker, dojo, ognl, etc. in order to effectively
use the S2 features.  All those packages should be optional.  

However, the thing about S2 which irks me most is the non-standard
expression language which sometimes uses one syntax and sometimes another.  

- Ray C.


> - Original Message -
> From: "Ian Roughley" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" 
> Subject: Re: Struts 2 Theme that doesn't generate extra HTML
> Date: Mon, 16 Jul 2007 09:10:01 -0400
> 
> 
> You can always use JSTL and HTML.
> 
> /Ian
> 
> Chris Pratt wrote:
> > Simple seems to be the closest, but unfortunately it is still run 
> > through the Freemarker templates, so it has the same overhead that 
> > the other themes have.
> >
> > You can, change the simple theme to remove those  &  the 
> > same way any other theme can be modified.
> >
> > But I'd love to find a way to use Struts 2 without theme support at 
> > all, with CSS and some good patterns you can achieve the same thing 
> > with a lot less overhead.
> >
> >  (*Chris*)
> >
> > On 7/15/07, Néstor Boscán <[EMAIL PROTECTED]> wrote:
> >> Hi
> >>
> >> Is there a Struts 2 Theme that doesn't generate extra HTML for the 
> >> tags. For example XHTML generates a lot of ,  and  
> >> and Simple will generate ,  errors for Field Errors. Also 
> >> in Simple Theme I can't get  to generate the JavaScript code
for Client Side Validation.
> >>
> >> Regards,
> >>
> >> Néstor Boscán
> >>
> >>
> >
> > 
> > - To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

>



- Ray Clough
[EMAIL PROTECTED]



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


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



RE: Struts 2 Theme that doesn't generate extra HTML

2007-07-17 Thread Néstor Boscán
Yes, I find S2 to be a good framework and a good evolution from S1, but the
tags themes instead of helping me are just making things more difficult. I
would also like to use JSTL and JSP but my project requires this tags and
OGNL.

Regards,

Néstor Boscán 

-Mensaje original-
De: Ray Clough [mailto:[EMAIL PROTECTED] 
Enviado el: Lunes, 16 de Julio de 2007 08:12 p.m.
Para: Struts Users Mailing List
Asunto: Re: Struts 2 Theme that doesn't generate extra HTML

I always try to use JSTL and JSP-EL when I can, but there used to be bugs in
the process of getting the JSTL tags to work with the value stack.  Are
those problems fixed in 2.0.8?. 

Then there is the question of Ajax in S2.  Completely abandoning the S2 tags
will require using Ajax from an independent source, since the S2 tags are
all tied into Dojo.  

What would be nice is a "zero-config" theme which just renders the basic
html tags, provides access to the value stack, and element-specific error
messages, and doesn't prevent using our own css and styles.  That really
irks me with the S2 tags - sometimes they won't let you specify your own
styles.

The 'themes' problem is one of the core twitches in S2 which I find more
than irritating.  I don't claim to have looked into the architecture of the
implementation, but if I follow the discussion correctly, all pages go thru
freemarker.  The inclusion of features which cannot be escaped, and which
rely on other packages which are largely black boxes makes an app developed
in S2 fragile.  As a developer, I have enough on my plate learning S2
without having to learn freemarker, dojo, ognl, etc. in order to effectively
use the S2 features.  All those packages should be optional.  

However, the thing about S2 which irks me most is the non-standard
expression language which sometimes uses one syntax and sometimes another.  

- Ray C.


> - Original Message -
> From: "Ian Roughley" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" 
> Subject: Re: Struts 2 Theme that doesn't generate extra HTML
> Date: Mon, 16 Jul 2007 09:10:01 -0400
> 
> 
> You can always use JSTL and HTML.
> 
> /Ian
> 
> Chris Pratt wrote:
> > Simple seems to be the closest, but unfortunately it is still run 
> > through the Freemarker templates, so it has the same overhead that 
> > the other themes have.
> >
> > You can, change the simple theme to remove those  &  the 
> > same way any other theme can be modified.
> >
> > But I'd love to find a way to use Struts 2 without theme support at 
> > all, with CSS and some good patterns you can achieve the same thing 
> > with a lot less overhead.
> >
> >  (*Chris*)
> >
> > On 7/15/07, Néstor Boscán <[EMAIL PROTECTED]> wrote:
> >> Hi
> >>
> >> Is there a Struts 2 Theme that doesn't generate extra HTML for the 
> >> tags. For example XHTML generates a lot of ,  and  
> >> and Simple will generate ,  errors for Field Errors. Also 
> >> in Simple Theme I can't get  to generate the JavaScript code
for Client Side Validation.
> >>
> >> Regards,
> >>
> >> Néstor Boscán
> >>
> >>
> >
> > 
> > - To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

>



- Ray Clough
[EMAIL PROTECTED]



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


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



RE: Struts 2 Theme that doesn't generate extra HTML

2007-07-17 Thread Néstor Boscán
Hi Kishen

I just want to use them like I did in Struts 1. Let the tags generate de
content but not extra design (, , , , ). I have a Web
Designer that takes care of my HTML design and if I add the tags it will
generate extra design that I don't need. 

For example for the  tag I just need to generate de JavaScript
Client-Side Validation and the  tag.

For  tag I just need to generate de message with the error.

Regards,

Néstor Boscán 

-Mensaje original-
De: Kishen Simbhoedatpanday [mailto:[EMAIL PROTECTED] 
Enviado el: Martes, 17 de Julio de 2007 05:40 a.m.
Para: user@struts.apache.org
Asunto: Re: Struts 2 Theme that doesn't generate extra HTML


How do you want your field errors displayed? 
I always use a the list tags for displaying lists

Maybe you can use the css_xhtml theme in the  tag.
And xhtml themes for formelements like textfields etc.
Still you will have the overhead when it comes to  and  tags.



Néstor Boscán-3 wrote:
> 
> Hi
>  
> Is there a Struts 2 Theme that doesn't generate extra HTML for the tags.
> For
> example XHTML generates a lot of ,  and  and Simple 
> will generate ,  errors for Field Errors. Also in Simple Theme 
> I can't get  to generate the JavaScript code for Client Side
Validation.
>  
> Regards,
>  
> Néstor Boscán
>  
> 
> 

--
View this message in context:
http://www.nabble.com/Struts-2-Theme-that-doesn%27t-generate-extra-HTML-tf40
82327.html#a11646156
Sent from the Struts - User mailing list archive at Nabble.com.


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


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



Re: How can I add ActionErrors when do the interceptor's intercept() method?

2007-07-17 Thread M.Liang Liu

Thanks for you quick reply,Nuwan.

yeah,ur code works and action-error should be add to the original action(I
tested).
However,I set my global result in my default package,and when the invalid
action accessing was intercepted,the browser was redirect to the login page.
It's strange that the action-error did NOT display.I am sure that my
interceptor has been configured correctly and the actionError has been add
to the very action.
I guess the global result whose type is "redirect" cause this problem,but am
not sure.

So,I define my login result as dispatch,which is default, it works.My global
result is follwing:


   /error.jsp
   /common/login.jsp
   /error.jsp
   
--

Does it work?yes.action error has been add and can display correctly.
The problem is that I can NOT use redirect type any more.As a result,the
doLogin action---the login form's action---can not mapped,as  the namespace
now is still the invalid action's.
eg.I access :http://localhost:8080/myapp/kms/showNews.tbs before logged in
Then access was intercepted and dispatched to :
http://localhost:8080/myapp/common/login.jsp
so I logged.
The form was submitted  to http://localhost:8080/myapp/kms/doLogin.tbs
which should be:http://localhost:8080/myapp/common/doLogin.tbs

Any comment?

Thanks a lot.
On 7/18/07, Nuwan Chandrasoma <[EMAIL PROTECTED]> wrote:


Hi,

hope this code will help you.

 Object action = invocation.getAction ();
 if (action instanceof com.opensymphony.xwork2.ValidationAware) {
  ((com.opensymphony.xwork2.ValidationAware) action).addActionError
("Username or password incorrect.");
 }

Thanks,

Nuwan.

- Original Message -
From: "M.Liang Liu" <[EMAIL PROTECTED]>
To: 
Sent: Tuesday, July 17, 2007 9:49 AM
Subject: How can I add ActionErrors when do the interceptor's intercept()
method?


>
> Hi,all
> I've got a problem when I put my own interceptors in my app:
> I write an interceptor to authenticate whether the user access the
current
> page or action has logged in.
> I write the code in the following style(refer to the mailreader
example):
> 
> ..
> public String intercept(ActionInvocation actionInvocation) throws
> Exception
> {
> Map session = actionInvocation.getInvocationContext().getSession();
> User user = (User) session.get(Constants.USER_KEY);
> boolean isAuthenticated = (null != user);
> if (isAuthenticated) {
> return actionInvocation.invoke();
> } else {
>//how to add actionErrors here?
> return Action.LOGIN;
> }
> .
>
> 
> The question is that :how can I addActionErrors to the interceptor,so
that
> when the invalid action---namelly not logged in---was redirected to the
> login page,some actionErrors messages like "You are not logged in" can
> display.
>
> I notice that I can put cite addActionErrors("You are not logged in");
in
> my
> action class,however,I do NOT have any hint how to add action errors in
my
> interceptor.
> Just or can't?
>
> Any comment would be appreciated.
> --
> View this message in context:
>
http://www.nabble.com/How-can-I-add-ActionErrors-when-do-the-interceptor%27s-intercept%28%29-method--tf4095868.html#a11646263
> Sent from the Struts - User mailing list archive at Nabble.com.
>


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





--
 --M.Liang Liu


error

2007-07-17 Thread naseer mohammed

i am trying to run struts-blank application which encounter this exception..


org.apache.jasper.JasperException: No Java compiler available

org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:387)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)



help me solve this problem


checkbox bug

2007-07-17 Thread TonyD

I'am not using a specified theme in my form.

In my jsp I have the following code:



and it generates the folowing HTML code:

 
   
   


   I want to be green 

 

How to change the label color to green? I tried in many ways, I think it's a
bug.
-- 
View this message in context: 
http://www.nabble.com/checkbox-bug-tf4096207.html#a11647345
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: How can I add ActionErrors when do the interceptor's intercept() method?

2007-07-17 Thread Nuwan Chandrasoma

Hi,

hope this code will help you.

Object action = invocation.getAction ();
if (action instanceof com.opensymphony.xwork2.ValidationAware) {
 ((com.opensymphony.xwork2.ValidationAware) action).addActionError 
("Username or password incorrect.");

}

Thanks,

Nuwan.

- Original Message - 
From: "M.Liang Liu" <[EMAIL PROTECTED]>

To: 
Sent: Tuesday, July 17, 2007 9:49 AM
Subject: How can I add ActionErrors when do the interceptor's intercept() 
method?





Hi,all
I've got a problem when I put my own interceptors in my app:
I write an interceptor to authenticate whether the user access the current
page or action has logged in.
I write the code in the following style(refer to the mailreader example):

..
public String intercept(ActionInvocation actionInvocation) throws 
Exception

{
Map session = actionInvocation.getInvocationContext().getSession();
User user = (User) session.get(Constants.USER_KEY);
boolean isAuthenticated = (null != user);
if (isAuthenticated) {
return actionInvocation.invoke();
} else {
   //how to add actionErrors here?
return Action.LOGIN;
}
.


The question is that :how can I addActionErrors to the interceptor,so that
when the invalid action---namelly not logged in---was redirected to the
login page,some actionErrors messages like "You are not logged in" can
display.

I notice that I can put cite addActionErrors("You are not logged in"); in 
my

action class,however,I do NOT have any hint how to add action errors in my
interceptor.
Just or can't?

Any comment would be appreciated.
--
View this message in context: 
http://www.nabble.com/How-can-I-add-ActionErrors-when-do-the-interceptor%27s-intercept%28%29-method--tf4095868.html#a11646263

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: Struts 2 + Spring 2 + JPA + AJAX Tutorial

2007-07-17 Thread LucaLuca

Hi,

I've tried to make some changes to make it work..But nothing!. These are my
configuration files:

---"ApplicationContext.xml":---


http://www.springframework.org/schema/beans";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:aop="http://www.springframework.org/schema/aop";
xmlns:tx="http://www.springframework.org/schema/tx";
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.0.xsd";>


  

  


   








 

   
 





  













---"Web.xml"---


http://java.sun.com/xml/ns/j2ee";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";>
quickstart

struts2

org.apache.struts2.dispatcher.FilterDispatcher




struts2
/*




org.springframework.web.context.ContextLoaderListener



 
index.jsp

 



--"Struts.xml"--


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

   



pages/list.jsp
pages/list.jsp



pages/list.jsp
pages/list.jsp



pages/list.jsp
pages/list.jsp





--"Struts.properties"--

struts.objectFactory = org.apache.struts2.spring.StrutsSpringObjectFactory
struts.devMode = true
struts.enable.DynamicMethodInvocation = false
struts.objectFactory.spring.autoWire = type


---This is my Stack error trace...:---



GRAVE: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'entityManagerFactory' defined in ServletContext resource
[/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested
exception is java.lang.NoClassDefFoundError:
org/hibernate/MappingNotFoundException
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1178)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:407)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:255)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:252)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:247)
at
org.springframework.beans.factory.BeanFactoryUtils.beansOfTypeIncludingAncestors(BeanFactoryUtils.java:257)
at
org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.detectPersistenceExceptionTranslators(PersistenceExceptionTranslationInterceptor.java:121)
at
org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.(PersistenceExceptionTranslationInterceptor.java:77)
at
org.springframework.dao.annotation.PersistenceExceptionTranslationAdvisor.(PersistenceExceptionTranslationAdvisor.java:70)
at
org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor.setBeanFactory(PersistenceExceptionTranslationPostProcessor.java:96)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1166)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:407)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:255)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:252)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at
org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:826)
at
org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:564)
at
org.springframework.context.support.AbstractApplicationC

答复: [S2]struts2 validation error message problem

2007-07-17 Thread chenshibing
You should modify your bean definition, 

 

If you’re using spring 2.0.x, 

 



 ….



 

Spring 1.xx





 

That ensure a new action was constructed every time a new request was sent, not 
 a singleton

Action bean.

 

 

Crazyreal

  _  

发件人: 钟原froast [mailto:[EMAIL PROTECTED] 
发送时间: 2007年7月17日 17:37
收件人: user@struts.apache.org
主题: [S2]struts2 validation error message problem

 

hi, this is my first web-based project using struts2.0. I met a problem when 
using the validation . It seems the error message haven't been cleared and each 
time I submit the form, then the error message was added after the previous 
error message, it means if i submit 10 times, then there will display 10 error 
message, 10 of the same. any help would be appreciated. 

 

struts-app.xml:


 
jsp/account/account.jsp 
 index.jsp


 
 
  
  
   /jsp/message.jsp 
 /jsp/message.jsp 
 /jsp/message.jsp
  test.jsp
 jsp/account/userList.jsp
 jsp/account/userRole.jsp
 jsp/account/personSet.jsp 
  
 

 

AccountAction:

Jsp:

validation.xml

 

see the files.

 

the error message look just like this;

*string length shoule be 4-10 *string length shoule be 4-10 *string length 
shoule be 4-10 *string length shoule be 4-10 *string length shoule be 4-10 
*string length shoule be 4-10 *string length shoule be 4-10 *string length 
shoule be 4-10 *string length shoule be 4-10 *string length shoule be 4-10 

 

 



How can I add ActionErrors when do the interceptor's intercept() method?

2007-07-17 Thread M.Liang Liu

Hi,all
I've got a problem when I put my own interceptors in my app:
I write an interceptor to authenticate whether the user access the current
page or action has logged in.
I write the code in the following style(refer to the mailreader example):

..
public String intercept(ActionInvocation actionInvocation) throws Exception
{
Map session = actionInvocation.getInvocationContext().getSession();
User user = (User) session.get(Constants.USER_KEY);
boolean isAuthenticated = (null != user);
if (isAuthenticated) {
return actionInvocation.invoke();
} else {
//how to add actionErrors here?
return Action.LOGIN;
}
.


The question is that :how can I addActionErrors to the interceptor,so that
when the invalid action---namelly not logged in---was redirected to the
login page,some actionErrors messages like "You are not logged in" can
display.

I notice that I can put cite addActionErrors("You are not logged in"); in my
action class,however,I do NOT have any hint how to add action errors in my
interceptor.
Just or can't?

Any comment would be appreciated.
-- 
View this message in context: 
http://www.nabble.com/How-can-I-add-ActionErrors-when-do-the-interceptor%27s-intercept%28%29-method--tf4095868.html#a11646263
Sent from the Struts - User mailing list archive at Nabble.com.


Re: Struts 2 Theme that doesn't generate extra HTML

2007-07-17 Thread Kishen Simbhoedatpanday

How do you want your field errors displayed? 
I always use a the list tags for displaying lists

Maybe you can use the css_xhtml theme in the  tag.
And xhtml themes for formelements like textfields etc.
Still you will have the overhead when it comes to  and  tags.



Néstor Boscán-3 wrote:
> 
> Hi 
>  
> Is there a Struts 2 Theme that doesn't generate extra HTML for the tags.
> For
> example XHTML generates a lot of ,  and  and Simple will
> generate ,  errors for Field Errors. Also in Simple Theme I can't
> get  to generate the JavaScript code for Client Side Validation.
>  
> Regards,
>  
> Néstor Boscán
>  
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Struts-2-Theme-that-doesn%27t-generate-extra-HTML-tf4082327.html#a11646156
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]struts2 validation error message problem

2007-07-17 Thread 钟原froast

hi, this is my first web-based project using struts2.0. I met a problem when
using the validation . It seems the error message haven't been cleared and
each time I submit the form, then the error message was added after the
previous error message, it means if i submit 10 times, then there will
display 10 error message, 10 of the same. any help would be appreciated.

struts-app.xml:


   jsp/account/account.jsp
index.jsp
   

   

 
 
  /jsp/message.jsp
/jsp/message.jsp
/jsp/message.jsp
test.jsp
jsp/account/userList.jsp
jsp/account/userRole.jsp
jsp/account/personSet.jsp
 


AccountAction:
Jsp:
validation.xml

see the files.

the error message look just like this;
*string length shoule be 4-10 *string length shoule be 4-10 *string length
shoule be 4-10 *string length shoule be 4-10 *string length shoule be
4-10 *string
length shoule be 4-10 *string length shoule be 4-10 *string length shoule be
4-10 *string length shoule be 4-10 *string length shoule be 4-10
<[EMAIL PROTECTED] contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>










function  check(){

var form = window.document.forms["account_form"];
if(form["account.loginname"].value.length == 0){
alert('登陆名不能为空!');
form["account.loginname"].focus();
return false;
}

if(form["account.name"].value.length==0){
alert('用户姓名不能为空!');
form["account.name"].focus();
return false;
}
form.action="account_save.shtml";
form.submit();
}
//var 
strURL='/jsp/messagebox.jsp?title=增加用户&msg=是否确认增加用户&type=save&actionUrl=AddUserAction!Add.shtml&doaction=AddUserAction';
//window.open(strURL,'_blank','status=no,resizable=0,toolbar=no,menubar=no,scrollbars=auto,width=30,height=50');





  

 
 










 
  

  

  
     
  
添加用户
  
  编辑用户[]
   
  [冻结帐号]
    [密码复位]
  
  
  
  

  



   

  
   

  * 登陆名称:
  account.loginname


  * 用户名称:
  account.name


  电子邮件:
  



  联系电话:
  






  






package com.gehouse.admin.web.action.account;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.gehouse.admin.bean.account.TXAccount;
import com.gehouse.admin.bean.account.TXAccountRole;
import com.gehouse.admin.bean.account.TXRole;
import com.gehouse.admin.service.ServiceException;
import com.gehouse.admin.util.Constants;
import com.gehouse.admin.util.OptionsLong;
import com.gehouse.admin.web.action.BaseCrudAction;

public class AccountAction extends BaseCrudAction {

private static final long serialVersionUID = 1L;

private static final Log logger = 
LogFactory.getLog(AccountAction.class);

private TXAccount account = null;

private String validat = null; // 登陆验证码

private boolean active;

private List roleValues = null;

private List roles = new ArrayList();

private List userRole = null;

private List allRole = null;

private int accountId;

private String retRef; 

 

how do I get latest version of xwork library or struts 2.0.8

2007-07-17 Thread David Harland
Hi,

As recommended in

http://cwiki.apache.org/confluence/display/WW/S2-001

I tried downloading and building the latest version of struts but
instead of getting 2.0.8 I got 2.1. 
I then tried to get the latest version xwork and build that, and that
had 3 errors.

Can someone please give me a link to a binary of either of them, which
ever is the better option, please.

Many Thanks

Dave.

__
Ufi Limited 
Registered in England No.  3980770 
Registered Office:  Dearing House, 1 Young Street, Sheffield, S1 4UP 

learndirect Solutions Ltd 
Registered in England No. 5081669 
Registered Office:  Dearing House, 1 Young Street, Sheffield, S1 4UP 

UFI Charitable Trust 
Registered in England No.  3658378 
Registered Charity No.  1081028 
Registered Office:  Dearing House, 1 Young Street, Sheffield, S1 4UP 

This email has been scanned by the MessageLabs Email Security System.

__

Re: Struts Resource Bundles (i18n)

2007-07-17 Thread Nuwan Chandrasoma

Hi,

You can define multiple resource bundle in struts config., one would be a 
default and other ones you should give a key.


eg:-





Thanks,

Nuwan


- Original Message - 
From: "Saravanan Vijayappan" <[EMAIL PROTECTED]>

To: "struts user" 
Sent: Tuesday, July 17, 2007 3:38 AM
Subject: Struts Resource Bundles (i18n)




Hi

I am using struts 1.3.8. I want to create resource bundle properties files 
for every JSP page, how that needs to be confirured in struts-config.xml 
since as i know there would be only one ApplicationResources. properties 
file all the jsp pages for every language..Can we create more than 
ApplicationResources.properties file every jsp and confiure it ?


Thanks & Regards,
Saravanan Vijayappan
IBM Pvt Ltd, Raleigh, NC-27709, USA.






Building a website is a piece of cake. Yahoo! Small Business gives you all 
the tools to get online.
http://smallbusiness.yahoo.com/webhosting 



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



Re: Does Tiles Layout page can have struts form components

2007-07-17 Thread Antonio Petrelli

2007/7/17, Arunkumar Balasubramanian <[EMAIL PROTECTED]>:



 

The calender icon on pagetwo.jsp is

 





You could use a "controller" (in the Tiles sense) for the definition that
stores an extra attribute (for example, the javascript command) and then
import it (via ) and put it in your "href" attribute.

Antonio