RE : validateValidWhen and javascript

2006-09-01 Thread Jean-Marie Pitre

Do you know what is the reason there isn't javascript validation for this rule ?


-Message d'origine-
De : Wendy Smoak [mailto:[EMAIL PROTECTED] 
Envoyé : jeudi 31 août 2006 17:55
À : Struts Users Mailing List
Objet : Re: validateValidWhen and javascript

On 8/31/06, Jean-Marie Pitre [EMAIL PROTECTED] wrote:

 Is there a javascript file to use validateValidWhen method on client
 side ?

No.  If you look in the bundled validation-rules.xml file for 1.3,
there is no 'jsFunction' attribute for validwhen.  (The JavaScript for
the default rules now lives in Commons Validator.)

http://svn.apache.org/repos/asf/struts/struts1/trunk/core/src/main/resources/org/apache/struts/validator/validator-rules.xml

The Java code for validwhen is generated by Antlr.  You can look at
the source, here:
http://svn.apache.org/repos/asf/struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/validwhen/

-- 
Wendy

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


---
Email Disclaimer
http://www.cofidis.be/emaildisclaimer.php


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



How to turn off logging info on struts startup?

2006-09-01 Thread Peter Neu
Hello,

 

how can I turn off the logging info struts gives me when it starts up? I
mean this stuff:

 

01.09.2006 09:02:44 org.apache.struts.tiles.TilesRequestProcessor
initDefinitionsMapping

INFO: Tiles definition factory found for request processor ''.

01.09.2006 09:02:47 org.apache.struts.util.PropertyMessageResources init

INFO: Initializing, config='org.apache.struts.taglib.html.LocalStrings',
returnNull=true

01.09.2006 09:02:47 org.apache.struts.util.PropertyMessageResources init

...

 

 

I use log4J as Logging Framework. 

 

Cheers,

Pete

 

 



[OT] Re: How to turn off logging info on struts startup?

2006-09-01 Thread Antonio Petrelli

Peter Neu ha scritto:

Hello,

 


how can I turn off the logging info struts gives me when it starts up? I
mean this stuff:
I use log4J as Logging Framework. 


Can you post your log4j.properties?

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



Re: Reg : Exception Handling

2006-09-01 Thread Antonio Petrelli

Karthikn ha scritto:

Hi,

I am new user. I am implementing exception handling in my
application.
In my action class I have try, catch block.
in the catch block

catch(Exception e)

  {

return mapping,findforward(failure);

}

I defined the failure forward in my struts-config.xml.
But the problem is that forward is not getting executed.
Can u please help on this.
  


Can you post your action mapping and your forward?

P.S.. The next time do not leave so much blank lines or no one will read 
your email :-)


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



RE: Reg : Exception Handling

2006-09-01 Thread Rokariya, Raman
Make sure that you have a mapping in Struts-Config.xml also, for the
respective 
action-mapping with the forward=failure

/Raman Rokariya

-Original Message-
From: Antonio Petrelli [mailto:[EMAIL PROTECTED] 
Sent: Friday, September 01, 2006 1:11 PM
To: Struts Users Mailing List
Subject: Re: Reg : Exception Handling


Karthikn ha scritto:
 Hi,

 I am new user. I am implementing exception handling in my
 application.
 In my action class I have try, catch block.
 in the catch block

 catch(Exception e)

   {

 return mapping,findforward(failure);

 }

 I defined the failure forward in my struts-config.xml.
 But the problem is that forward is not getting executed.
 Can u please help on this.
   

Can you post your action mapping and your forward?

P.S.. The next time do not leave so much blank lines or no one will read

your email :-)

-
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]



AW: [OT] Re: How to turn off logging info on struts startup?

2006-09-01 Thread Peter Neu
That's it: 

log4j.rootLogger=INFO, cons
log4j.logger.de.ktbl=, myAppender
log4j.appender.cons=org.apache.log4j.ConsoleAppender
log4j.appender.myAppender=org.apache.log4j.RollingFileAppender
log4j.appender.myAppender.File=/usr/local/log/nbw06.log

#create max. 5 BackUp Files
log4j.appender.myAppender.MaxBackupIndex=5

#max File Size 1MB
log4j.appender.myAppender.MaxFileSize=1MB

#the root logger's layout
log4j.appender.cons.layout=org.apache.log4j.SimpleLayout
log4j.appender.myAppender.layout=org.apache.log4j.PatternLayout
log4j.appender.myAppender.layout.ConversionPattern= %n %-5p [%d{dd.MM.yy
HH:mm:ss}] - %m




 -Ursprüngliche Nachricht-
 Von: Antonio Petrelli [mailto:[EMAIL PROTECTED]
 Gesendet: Freitag, 1. September 2006 09:34
 An: Struts Users Mailing List
 Betreff: [OT] Re: How to turn off logging info on struts startup?
 
 Peter Neu ha scritto:
  Hello,
 
 
 
  how can I turn off the logging info struts gives me when it starts up? I
  mean this stuff:
  I use log4J as Logging Framework.
 
 Can you post your log4j.properties?
 
 -
 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: Reg : Exception Handling

2006-09-01 Thread Li

return mapping,findforward(failure);


should it be : return mapping.findforward(failure); (you use ',' here, it
should be '.')


On 9/1/06, Rokariya, Raman [EMAIL PROTECTED] wrote:


Make sure that you have a mapping in Struts-Config.xml also, for the
respective
action-mapping with the forward=failure

/Raman Rokariya

-Original Message-
From: Antonio Petrelli [mailto:[EMAIL PROTECTED]
Sent: Friday, September 01, 2006 1:11 PM
To: Struts Users Mailing List
Subject: Re: Reg : Exception Handling


Karthikn ha scritto:
 Hi,

 I am new user. I am implementing exception handling in my
 application.
 In my action class I have try, catch block.
 in the catch block

 catch(Exception e)

   {

 return mapping,findforward(failure);

 }

 I defined the failure forward in my struts-config.xml.
 But the problem is that forward is not getting executed.
 Can u please help on this.


Can you post your action mapping and your forward?

P.S.. The next time do not leave so much blank lines or no one will read

your email :-)

-
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]





--
When we invent time, we invent death.


Re: [OT] Re: How to turn off logging info on struts startup?

2006-09-01 Thread Leon Rosenberg

log4j.rootLogger=ERROR, cons

or
log4j.logger.org.apache.struts=ERROR, myAppender


On 9/1/06, Peter Neu [EMAIL PROTECTED] wrote:

That's it:

log4j.rootLogger=INFO, cons
log4j.logger.de.ktbl=, myAppender
log4j.appender.cons=org.apache.log4j.ConsoleAppender
log4j.appender.myAppender=org.apache.log4j.RollingFileAppender
log4j.appender.myAppender.File=/usr/local/log/nbw06.log

#create max. 5 BackUp Files
log4j.appender.myAppender.MaxBackupIndex=5

#max File Size 1MB
log4j.appender.myAppender.MaxFileSize=1MB

#the root logger's layout
log4j.appender.cons.layout=org.apache.log4j.SimpleLayout
log4j.appender.myAppender.layout=org.apache.log4j.PatternLayout
log4j.appender.myAppender.layout.ConversionPattern= %n %-5p [%d{dd.MM.yy
HH:mm:ss}] - %m




 -Ursprüngliche Nachricht-
 Von: Antonio Petrelli [mailto:[EMAIL PROTECTED]
 Gesendet: Freitag, 1. September 2006 09:34
 An: Struts Users Mailing List
 Betreff: [OT] Re: How to turn off logging info on struts startup?

 Peter Neu ha scritto:
  Hello,
 
 
 
  how can I turn off the logging info struts gives me when it starts up? I
  mean this stuff:
  I use log4J as Logging Framework.

 Can you post your log4j.properties?

 -
 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]




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



Re: AW: [OT] Re: How to turn off logging info on struts startup?

2006-09-01 Thread Antonio Petrelli

Peter Neu ha scritto:
That's it: 


log4j.rootLogger=INFO, cons
  


Change it to:

log4j.rootLogger=ERROR, cons


(ERROR level will be enough high for your debugging purposes)



log4j.logger.de.ktbl=, myAppender
  


Change it to :

log4j.logger.de.ktbl=DEBUG, cons, myAppender
log4j.additivity.de.ktbl=false


(I suppose that de.ktbl is a package of yours).

HTH
Antonio

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



AW: AW: [OT] Re: How to turn off logging info on struts startup?

2006-09-01 Thread Peter Neu
Hm, file looks now like this:

log4j.rootLogger=ERROR, cons
log4j.appender.cons=org.apache.log4j.ConsoleAppender
log4j.logger.de.ktbl=DEBUG, cons, myAppender
log4j.additivity.de.ktbl=false
log4j.appender.myAppender=org.apache.log4j.RollingFileAppender
log4j.appender.myAppender.File=c:/nbw06-2.log
log4j.appender.myAppender.MaxBackupIndex=5
log4j.appender.myAppender.MaxFileSize=1MB
log4j.appender.cons.layout=org.apache.log4j.SimpleLayout
log4j.appender.myAppender.layout=org.apache.log4j.PatternLayout
log4j.appender.myAppender.layout.ConversionPattern= %n %-5p [%d{dd.MM.yy
HH:mm:ss}] - %m


Struts Initialization log output still appears. Other output from app is
gone. Log file stays empty. 



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



Re: AW: AW: [OT] Re: How to turn off logging info on struts startup?

2006-09-01 Thread Antonio Petrelli

Peter Neu ha scritto:

Hm, file looks now like this:

log4j.rootLogger=ERROR, cons
log4j.appender.cons=org.apache.log4j.ConsoleAppender
log4j.logger.de.ktbl=DEBUG, cons, myAppender
log4j.additivity.de.ktbl=false
log4j.appender.myAppender=org.apache.log4j.RollingFileAppender
log4j.appender.myAppender.File=c:/nbw06-2.log
log4j.appender.myAppender.MaxBackupIndex=5
log4j.appender.myAppender.MaxFileSize=1MB
log4j.appender.cons.layout=org.apache.log4j.SimpleLayout
log4j.appender.myAppender.layout=org.apache.log4j.PatternLayout
log4j.appender.myAppender.layout.ConversionPattern= %n %-5p [%d{dd.MM.yy
HH:mm:ss}] - %m


Struts Initialization log output still appears.


All logs or only from ERROR level and above?

Other output from app is gone. Log file stays empty. 
  


Sounds strange. Are you sure you are using de.ktbl package in your 
application? And do you call the logger this way?


Logger logger = Logger.getLogger(MyApplicationClass.class);



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



AW: AW: AW: [OT] Re: How to turn off logging info on struts startup?

2006-09-01 Thread Peter Neu
*Argh* sometimes I'm just stupid. Yes, package name was wrong. 

I see this struts logging INFO for example:

01.09.2006 11:31:46 org.apache.struts.util.PropertyMessageResources init
INFO: Initializing, config='org.apache.struts.taglib.html.LocalStrings',
returnNull=true





 -Ursprüngliche Nachricht-
 Von: Antonio Petrelli [mailto:[EMAIL PROTECTED]
 Gesendet: Freitag, 1. September 2006 11:26
 An: Struts Users Mailing List
 Betreff: Re: AW: AW: [OT] Re: How to turn off logging info on struts
 startup?
 
 Peter Neu ha scritto:
  Hm, file looks now like this:
 
  log4j.rootLogger=ERROR, cons
  log4j.appender.cons=org.apache.log4j.ConsoleAppender
  log4j.logger.de.ktbl=DEBUG, cons, myAppender
  log4j.additivity.de.ktbl=false
  log4j.appender.myAppender=org.apache.log4j.RollingFileAppender
  log4j.appender.myAppender.File=c:/nbw06-2.log
  log4j.appender.myAppender.MaxBackupIndex=5
  log4j.appender.myAppender.MaxFileSize=1MB
  log4j.appender.cons.layout=org.apache.log4j.SimpleLayout
  log4j.appender.myAppender.layout=org.apache.log4j.PatternLayout
  log4j.appender.myAppender.layout.ConversionPattern= %n %-5p [%d{dd.MM.yy
  HH:mm:ss}] - %m
 
 
  Struts Initialization log output still appears.
 
 All logs or only from ERROR level and above?
 
  Other output from app is gone. Log file stays empty.
 
 
 Sounds strange. Are you sure you are using de.ktbl package in your
 application? And do you call the logger this way?
 
 Logger logger = Logger.getLogger(MyApplicationClass.class);
 
 
 
 -
 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: [OT] Re: How to turn off logging info on struts startup?

2006-09-01 Thread Antonio Petrelli

Peter Neu ha scritto:

I see this struts logging INFO for example:

01.09.2006 11:31:46 org.apache.struts.util.PropertyMessageResources init
INFO: Initializing, config='org.apache.struts.taglib.html.LocalStrings',
returnNull=true
  


Try to use Leon's suggestion:

log4j.logger.org.apache.struts=ERROR, myAppender

Probably the Struts logger is not the root logger... 8-|
If it does not work, retry setting the additivity to false.


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



Reg : JSP Exception Handling Problem with Tiles

2006-09-01 Thread jaikarthi

Hi,
I am trying to handle JSP Exception in my Project. We are using Tiles
plug in in our project.
My Layout definition is
  

  

   
 

   My header and footer remains same in all pages.

  in my layout.jsp 

I defined 

%@ page errorPage=/jspException.do

whenever jsp exception occurs,JSP Exception handler gets invoked and I am
redircting to error page.

my struts config looks like this,





my action class gets executed and success is forwarded,but i am getting a
blank page.
only header.jsp alone rendered,my error.jsp is not rendered.

my error.jsp is 

%@ page isErrorPage=true%


 


unexpected error occured



I dont know why? i am badly in need of this.

Please help me Guys  i am looking for ur reply

Thanks,
JaiKarthik
-- 
View this message in context: 
http://www.nabble.com/Reg-%3A-JSP-Exception-Handling-Problem-with-Tiles-tf2202000.html#a6096810
Sent from the Struts - User forum at Nabble.com.


Re: Reg : JSP Exception Handling Problem with Tiles

2006-09-01 Thread Antonio Petrelli

It seems that your message has been corrupted. Try to resend it.

jaikarthi ha scritto:

Hi,
I am trying to handle JSP Exception in my Project. We are using Tiles
plug in in our project.
My Layout definition is
  
	
  

   
 


   My header and footer remains same in all pages.

  in my layout.jsp 

I defined 


%@ page errorPage=/jspException.do

whenever jsp exception occurs,JSP Exception handler gets invoked and I am
redircting to error page.

my struts config looks like this,





my action class gets executed and success is forwarded,but i am getting a
blank page.
only header.jsp alone rendered,my error.jsp is not rendered.

my error.jsp is 


%@ page isErrorPage=true%


	 



unexpected error occured



I dont know why? i am badly in need of this.

Please help me Guys  i am looking for ur reply

Thanks,
JaiKarthik
  



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



Re: Reg : JSP Exception Handling Problem with Tiles

2006-09-01 Thread jaikarthi

Hi,
please find the problem

   Hi, 
I am trying to handle JSP Exception in my Project. We are using Tiles
plug in in our project. 
My Layout definition is 
  definition name=page.layout path=/WEB-INF/pages/tiles/Layout.jsp 
put name=title  value=/ 
  put name=header  value=/WEB-INF/pages/tiles/header.jsp/ 
put name=body value= / 
   put name=footer  value=/WEB-INF/pages/tiles/footer.jsp/ 
 /definition 

   My header and footer remains same in all pages. 

  in my layout.jsp 

I defined 

%@ page errorPage=/jspException.do 

whenever jsp exception occurs,JSP Exception handler gets invoked and I am
redircting to error page. 

my struts config looks like this, 

action 
path=/jspException 
 type=com.sen.exception.JspExceptionHandlerAction 
scope=request  
forward name=success path=/WEB-INF/pages/error.jsp
redirect=false/ 
/action 

my action class gets executed and success is forwarded,but i am getting a
blank page. 
only header.jsp alone rendered,my error.jsp is not rendered. 

my error.jsp is 

%@ page isErrorPage=true% 
html 
head 
basefont face=Arial color=red 
/head 
body 
h2unexpected error occured/h2 
/body 
/html 

I dont know why? i am badly in need of this. 

Please help me Guys  i am looking for ur reply 

Thanks, 
JaiKarthik



Antonio Petrelli wrote:
 
 It seems that your message has been corrupted. Try to resend it.
 
 jaikarthi ha scritto:
 Hi,
 I am trying to handle JSP Exception in my Project. We are using Tiles
 plug in in our project.
 My Layout definition is
   
  
   
 

  

My header and footer remains same in all pages.

   in my layout.jsp 

 I defined 

 %@ page errorPage=/jspException.do

 whenever jsp exception occurs,JSP Exception handler gets invoked and I am
 redircting to error page.

 my struts config looks like this,


  


 my action class gets executed and success is forwarded,but i am getting a
 blank page.
 only header.jsp alone rendered,my error.jsp is not rendered.

 my error.jsp is 

 %@ page isErrorPage=true%


   


 unexpected error occured



 I dont know why? i am badly in need of this.

 Please help me Guys  i am looking for ur reply

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

-- 
View this message in context: 
http://www.nabble.com/Reg-%3A-JSP-Exception-Handling-with-tiles-tf2202000.html#a6096918
Sent from the Struts - User forum at Nabble.com.


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



How to access Struts2 FilterDispatcher

2006-09-01 Thread Ingo.Harbeck
Hi,
 
is there any way to get access to the initialized 
instance of a Filter Class running in the same 
context of the webserver.
 
(I try to get access to the Struts2 FilterDispatcher)
 
Best wishes,
Ingo


Re: Reg : JSP Exception Handling Problem with Tiles

2006-09-01 Thread Antonio Petrelli

jaikarthi ha scritto:
  definition name=page.layout path=/WEB-INF/pages/tiles/Layout.jsp 
put name=title  value=/ 
  put name=header  value=/WEB-INF/pages/tiles/header.jsp/ 
put name=body value= / 
   put name=footer  value=/WEB-INF/pages/tiles/footer.jsp/ 
 /definition 


...

action 
path=/jspException 
 type=com.sen.exception.JspExceptionHandlerAction 
scope=request  
forward name=success path=/WEB-INF/pages/error.jsp
redirect=false/ 
/action 


my action class gets executed and success is forwarded,but i am getting a
blank page. 
  


It is strange, since the error.jsp is a simple JSP page. Have you got 
any exception in your log?



only header.jsp alone rendered,


What do you mean with this?


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



Mapping between a request parameter name and a Struts form property name

2006-09-01 Thread Andrey Falaleev
Hello everybody,

I'd have the following question: Let's suppose I call a Struts action, which is 
bound to a particular form through struts-config.xml. As far as I know, the 
request is being analysed internally by Struts at the beginning, such that for 
each form property the corresponding request parameter is searched by name. 
E.g., if there is a property 'id' in a form, the reqest is analysed for an 'id' 
parameter. Am I right? 

The question is: may I specify a request parameter name for the particular form 
property manually? E.g., to tell Struts that for the form property 'id' I would 
like to use the request parameter 'objectId'?

If the above case is possible, are there any differences, whether a form is in 
the request or session scope?

Thanks in advance,
Andrew



-
Yahoo! Messenger -  kostenlos* mit Familie und Freunden von PC zu PC 
telefonieren. 

Re: Reg : JSP Exception Handling Problem with Tiles

2006-09-01 Thread jaikarthi

Hi,
  I am not getting any exception in log.

Antonio Petrelli wrote:
 
 jaikarthi ha scritto:
   definition name=page.layout path=/WEB-INF/pages/tiles/Layout.jsp 
 put name=title  value=/ 
   put name=header 
 value=/WEB-INF/pages/tiles/header.jsp/ 
 put name=body value= / 
put name=footer  value=/WEB-INF/pages/tiles/footer.jsp/ 
  /definition 

 ...

 action 
 path=/jspException 
  type=com.sen.exception.JspExceptionHandlerAction 
 scope=request  
 forward name=success path=/WEB-INF/pages/error.jsp
 redirect=false/ 
 /action 

 my action class gets executed and success is forwarded,but i am getting a
 blank page. 
   
 
 It is strange, since the error.jsp is a simple JSP page. Have you got 
 any exception in your log?
 
 only header.jsp alone rendered,
 
 What do you mean with this?
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Reg-%3A-JSP-Exception-Handling-with-tiles-tf2202000.html#a6098356
Sent from the Struts - User forum at Nabble.com.


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



AW: How to access Struts2 FilterDispatcher

2006-09-01 Thread Ingo.Harbeck
I will implement the DispatcherListener...

-Ursprüngliche Nachricht-
Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Gesendet: Freitag, 1. September 2006 13:29
An: user@struts.apache.org
Betreff: How to access Struts2 FilterDispatcher


Hi,
 
is there any way to get access to the initialized 
instance of a Filter Class running in the same 
context of the webserver.
 
(I try to get access to the Struts2 FilterDispatcher)
 
Best wishes,
Ingo

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



Re: Dynamically Initializing Checkbox Value

2006-09-01 Thread Albert L. Sapp

Anthony,

See my comments below.  Hope this clears things up a little and I see 
Laurie has made a worthwhile comment about looking at the examples 
available.


HTH,

Al


Anthony N. Frasso wrote:

My head hurts. :)  Thanks for everyone's help.  I've
gotten a number of responses, it's just that I'm still
confused.  It's obvious I have something drastically
wrong with my understanding of the workflow of Struts,
so I'd like to clear that up now.

Let's take my list page, ListRoles.jsp:

html:form action=/EditRoles method=GET
  html:hidden property=actionCode /
  html:hidden property=roleId /
  c:if test=${fn:length(roles)  0}
table class=list
  tr
thName/th
thDescription/th
  /tr
  c:forEach items=${roles} var=role step=1
tr
  tdc:out value=${role.name} //td
  td
c:out value=${role.description} /
  /td
  td
html:link href=(some javascript)
  Edit
/html:link
  /td
  td
html:link href=(some javascript)
  Delete
/html:link
  /td
/tr
  /c:forEach
/table
  /c:if
/html:form

This form lists all roles in the system.  Next to each
role, there are two links: one to edit the role, and
the other to delete it.  These links simply execute
some javascript that populate the hidden form fields
and then submit the form.
  
Uh, do you do a lot in the javascript besides set the hidden fields?  
Here is an example of how I pass similar information.  Of course, I 
don't have a action to pass as each possible operation has it's own 
action.  Actual 2.  One to prepare the form data to be displayed to the 
user to update and then one to process the data after the user submits 
the form.


a  href=html:rewrite 
href=preUpdateInventoryItem?inventoryID=${inventoryItem.inventoryID}/

   html:img pageKey=images.updateIcon border=0/
/a


When the form is submitted, the form bean is
populated.  Here is the form bean
(EditRolesForm.java):

public class EditRolesForm extends ActionForm {

private static final long serialVersionUID = 0;

public static final String ADD_ACTION_CODE =
add;
public static final String DELETE_ACTION_CODE =
delete;
public static final String EDIT_ACTION_CODE =
edit;

private String actionCode;
private int roleId;

public String getActionCode() {

return actionCode;
}

public int getRoleId() {

return roleId;
}

public void setActionCode(String actionCode)

// some validation done here, and the action
// code is then set
}

public void setRoleId(int roleId) {

this.roleId = roleId;
}
}

Nice and simple. :)  Now, when the form is submitted,
and as I understand it, *after* the form bean is
populated, the execute method is called for the Action
class.  Here is my the Action class I created for this
action (EditRolesAction.java):

public class EditRolesAction extends TransactionAction
{

public ActionForward execute(ActionMapping
mapping,
 ActionForm form,
 HttpServletRequest
 request,
 HttpServletResponse
 response)
throws Exception {

EditRolesForm editRolesForm =
(EditRolesForm) form;

// at this point, I believe the form is
// *already* populated.

// do some computation, place the correct
// role in the request scope, and determine
// the correct forward
request.setAttribute(role, role);
  

Ok, instead of request.setAttribute(role, role); try this.

EditRoleForm editRoleForm = new EditRoleForm();
editRoleForm.setID(role.getID);
.
. Set the rest of your form fields.
.
request.setAttribute(role, editRoleForm);

Your jsp, then, has the information it needs to set the initial value of 
all your fields and checkboxes.  This is the way I do it for my edit and 
delete confirmation jsps.

return mapping.findForward(...);
}
}

So now, assuming the user has asked to do an edit, the
EditRole.jsp is generated:

html:form action=/EditRole method=POST
  table
tr
  tdName:/td
  tdhtml:text property=name
 value=${role.name} //td
/tr
tr
  tdDescription:/td
  td
html:textarea property=roleDescription
   value=${role.description} /
  /td
/tr
tr
  tdblah/td
  tdhtml:checkbox  //td
/tr
tr
  tdnbsp;/td
  tdhtml:submit value=Submit //td
  /table
/html:form

Here is the EditRoleForm form bean:

public class EditRoleForm {

private int id;
private String name;
private String description;

private boolean permissionA;
private boolean permissionB;
...
private boolean permissionN;
}

So the question is... I *don't* have access to the
EditRoleForm form 

reset() method

2006-09-01 Thread Sonu S

Hi,

I am using struts in my application. i am using reset and validation. i am
not writing any validation method. i am using struts' validation framework.
validation is working. reset also works fine in application if i enter some
values in form  (text box) and press reset, it clears form values.

but if i follow these steps, reset does not work

1) enter some values in form
2) click submit button
3) validation fails
4)  return to form
5) values are still in text box
6) here if i press reset button it does not reset the form values.  it calls
reset method ( i have checked reset method is being called) but it does not
reset the text box,

i want to reset the form every time reset button is clicked.


thank u


html:image tag and User bypassing onclick() by pressing ENTER

2006-09-01 Thread Mississippi John Hurt

I have an html:image tag with onClick set. So when users press button, it
does something. The problem is what if user type input into a field say
keywordSearch, then they press ENTER.  In that case the logic in the
onClick attribute is not executed.  I tried to put that into an onSubmit
tag, but there's no such attibute. So how can I get it so that if a user
press ENTER instead of clicking the button, that I can execute some custom
logic (to set form param) before it goes to my Action class?  Thanks.


Re: html:image tag and User bypassing onclick() by pressing ENTER

2006-09-01 Thread Mississippi John Hurt

The html:form has an onsubmit but how would it know which button was
pressed?

On 9/1/06, Mississippi John Hurt [EMAIL PROTECTED] wrote:


I have an html:image tag with onClick set. So when users press button,
it does something. The problem is what if user type input into a field say
keywordSearch, then they press ENTER.  In that case the logic in the
onClick attribute is not executed.  I tried to put that into an onSubmit
tag, but there's no such attibute. So how can I get it so that if a user
press ENTER instead of clicking the button, that I can execute some custom
logic (to set form param) before it goes to my Action class?  Thanks.



Re: reset() method

2006-09-01 Thread nuwan chandrasoma

Hi,

what is the scope the form is in? i think it must be session. what you can
do is with out adding a reset button, add a normal button and call a
javascript with would reset the values in the from elements explicitly. i
had the same problem. this what i did.

Thanks,

Nuwan

On 9/1/06, Sonu S [EMAIL PROTECTED] wrote:


Hi,

I am using struts in my application. i am using reset and validation. i am
not writing any validation method. i am using struts' validation
framework.
validation is working. reset also works fine in application if i enter
some
values in form  (text box) and press reset, it clears form values.

but if i follow these steps, reset does not work

1) enter some values in form
2) click submit button
3) validation fails
4)  return to form
5) values are still in text box
6) here if i press reset button it does not reset the form values.  it
calls
reset method ( i have checked reset method is being called) but it does
not
reset the text box,

i want to reset the form every time reset button is clicked.


thank u




[OT][ANN] JAVAWUG BOF 21 / 5th Sept 2006 @ 18:30 / SkillsMatter / Max Antoni / AJAX Objected Oriented Javascript

2006-09-01 Thread Peter . Pilgrim

Hi All

I would like remind you of the twentieth first birds-of-a-feather (BOF
21) of the Java Web Users Group, taking part at the Skillmatters
building, London, England
on Tuesday 5th September 2006

FYI:
http://www.jroller.com/page/javawug?entry=announcement_javabof_xxi_max_a
ntoni

The feature speakers:

Max Antoni, 
Java Web Freelancer Software Developer

How to write object oriented AJAX applications. 

Max Antoni is working at UBS as a freelancer. 
He is working on the front-end Java web development 
of an portal enterprise application. He will be
cover AJAX development and how to write object oriented
Javascript. 

In the last years Max have collected some best
practices 
and he has lot of experience about how object
orientation 
works in languages derived from ECMA Script, 
like todays Javascript implementations.

Max started working with browser based applications in
2004 
and soon came across the idea of writing his own 
Java based application server, suiting the needs of 
his own applications. This idea brought EvaServer to
life
(See http://www.maxantoni.de website is in German) 
and now he is working towards to release a version 1.0 
by the end of this year.

We are both working on the same development portal 
project at the prestiguous UBS Investment Bank and 
IMHO Max cooks really great AJAXified web user
interfaces.


For more information 
http://www.jroller.com/page/javawug?entry=announcement_javabof_xxi_max_a
ntoni

JAVAWUG Mailing List
http://groups.google.com/group/javawug

--
Peter Pilgrim
JUG Leader ( JAVAWUG
http://developers.sun.com/jugs/display/europe/gbr/london )

   ( ( (  (   (  
   (   )\(   (   )\)\))(   '   (  )\ )  
   )_)(  )\  )_)( ((_)()\ ))\(()/(  
  ((_)\ _ )\((_)((_)\ _ )\_(())\_)()_ ((_)/(_))_  
_ | (_)_\(_) \ / /(_)_\(_) \((_)/ / | | (_)) __|
| || |/ _ \  \ V /  / _ \  \ \/\/ /| |_| | | (_ |
 \__//_/ \_\  \_/  /_/ \_\  \_/\_/  \___/   \___|
= 

Visit our website at http://www.ubs.com

This message contains confidential information and is intended only
for the individual named.  If you are not the named addressee you
should not disseminate, distribute or copy this e-mail.  Please
notify the sender immediately by e-mail if you have received this
e-mail by mistake and delete this e-mail from your system.

E-mail transmission cannot be guaranteed to be secure or error-free
as information could be intercepted, corrupted, lost, destroyed,
arrive late or incomplete, or contain viruses.  The sender therefore
does not accept liability for any errors or omissions in the contents
of this message which arise as a result of e-mail transmission.  If
verification is required please request a hard-copy version.  This
message is provided for informational purposes and should not be
construed as a solicitation or offer to buy or sell any securities or
related financial instruments.


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



Re: RE : validateValidWhen and javascript

2006-09-01 Thread Laurie Harper
It's not really practicable, considering that a validwhen rule can 
address other properties on the form bean that may or may not have any 
client-side representation, or may have a different representation on 
the client (e.g. strings vs. integers).


L.

Jean-Marie Pitre wrote:

Do you know what is the reason there isn't javascript validation for this rule ?


-Message d'origine-
De : Wendy Smoak [mailto:[EMAIL PROTECTED] 
Envoyé : jeudi 31 août 2006 17:55

À : Struts Users Mailing List
Objet : Re: validateValidWhen and javascript

On 8/31/06, Jean-Marie Pitre [EMAIL PROTECTED] wrote:


Is there a javascript file to use validateValidWhen method on client
side ?


No.  If you look in the bundled validation-rules.xml file for 1.3,
there is no 'jsFunction' attribute for validwhen.  (The JavaScript for
the default rules now lives in Commons Validator.)

http://svn.apache.org/repos/asf/struts/struts1/trunk/core/src/main/resources/org/apache/struts/validator/validator-rules.xml

The Java code for validwhen is generated by Antlr.  You can look at
the source, here:
http://svn.apache.org/repos/asf/struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/validwhen/





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



Re: Mapping between a request parameter name and a Struts form property name

2006-09-01 Thread David Durham

Andrey Falaleev wrote:

Hello everybody,

I'd have the following question: Let's suppose I call a Struts action, which is bound to a particular form through struts-config.xml. As far as I know, the request is being analysed internally by Struts at the beginning, such that for each form property the corresponding request parameter is searched by name. E.g., if there is a property 'id' in a form, the reqest is analysed for an 'id' parameter. Am I right? 


The question is: may I specify a request parameter name for the particular form 
property manually? E.g., to tell Struts that for the form property 'id' I would 
like to use the request parameter 'objectId'?


I don't think this is possible in struts without serious modifications. 
  Perhaps with a composable request processor, but as it stands, I 
think the following method is employed:


  http://tinyurl.com/k9f69

and it basically copies based on property names.  I question the 
validity of this request parameter to bean property map.  Seems easier 
and reasonable to impose matching names.



-Dave

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



RE: Mapping between a request parameter name and a Struts form property name

2006-09-01 Thread David Friedman
You jogged my memory and I have a solution from the Appendix of Struts In
Action.  Version 1.1 and onward (possibly even in 1.0), struts
ActionMappings have had two attributes: prefix and suffix. The are from
the ActionConfig class but carry over to the ActionMapping class used by the
Struts-Config.xml. Their use would be (you probably shouldn't mix them as in
this stupid example):

action 
name=someForm
prefix=...
suffix=...
/
/action

The JavaDocs from the ActionConfig class (ActionMapping extends it) are:

Prefix used to match request parameter names to form bean property names, if
any.
Suffix used to match request parameter names to form bean property names, if
any.

So how/why would you use it?  Do you plan on having a wizard where some
field names are the same on different pages?  That way page 1 variables
could be oneId, oneTextField, etc. then page two could be
twoId, twoUsername, twoPassword, and page3 could be threeId,
threeShippingAddr1, etc. all within the same ActionForm/Pojo?  If that is
the case I guess it could make wizards easier and avoid variable collision.

Regards,
David

-Original Message-
From: David Durham [mailto:[EMAIL PROTECTED]
Sent: Friday, September 01, 2006 4:42 PM
To: Struts Users Mailing List
Subject: Re: Mapping between a request parameter name and a Struts form
property name


Andrey Falaleev wrote:
 Hello everybody,

 I'd have the following question: Let's suppose I call a Struts
 action, which is bound to a particular form through struts-config.xml.
 As far as I know, the request is being analysed internally by Struts
 at the beginning, such that for each form property the corresponding
 request parameter is searched by name. E.g., if there is a property
 'id' in a form, the reqest is analysed for an 'id' parameter. Am I
 right?

 The question is: may I specify a request parameter name for
 the particular form property manually? E.g., to tell Struts
 that for the form property 'id' I would like to use the request
 parameter 'objectId'?



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