Re: Struts filter help

2006-05-07 Thread Stanislav
Thank you very much!

This is what i was assking for ! :-)))


Stanislav

- Original Message Follows -
> On Fri, 2006-05-05 at 15:19 +0200, Stanislav wrote:
> > Hi!
> > 
> > I want to do some check every time when java file "starts". How can i do 
> > this? I think that is
> > posible with filter in web.xml, but i dont know how to do this :-(
> 
> in web.xml put these tags:
> 
> 
> check
>   packageName.CheckFilter
> 
> 
> 
> check
> *.do
> 
> 
> 
> This sets up a filter to run the doFilter method of the CheckFilter
> class on all requests with a .do extension. CheckFilter is like this:
> 
> public final class CheckFilter implements Filter {
> 
> public void doFilter(ServletRequest request, 
>  ServletResponse response,
>  FilterChain chain)
> throws IOException, ServletException {
> 
> 
> // run your check here
> 
> }
> 
> }
> 
> 
> Dave
> 
> > 
> > Tnx, 
> > Stanislav
> > 
> > -
> > 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: Issue with checkboxes!

2006-05-07 Thread 王曾wang_zeng

you can also override the reset() method like this:

public void reset(ActionMapping mapping, HttpServletRequest request){
  this.initialize();
}

in  the dynamic form class ,there is a initialize() method which will clear
all the properties. The initialize() is called only when the bean is
instantiated.


Re: Validation Problems

2006-05-07 Thread Richard Yee

Sandeep,
You can do complex validations in your ActionForm validate method. You 
can also still invoke Validator validations by calling super.validate() 
in your validation method if you are extending 
|org.apache.struts.validator.action.ValidatorForm


I have found that there are many situations where complex validations 
are more easily handled in a validate() rather than trying to use 
validwhen or requiredif in the validation.xml


-Richard
|
Sandeep Dhanuka wrote:

Hi Everyone,

I am using struts validatior to valiate my form on JSP and dont want 
to take

validation to my Action class.

I have a check box and a text box on my JSP. I want to validate text 
box to

have 19 characters when check box is not checked and 17 characters when
checkbox is checked.

How should I go about solving the problem using "validwhen".


Regards
Sandeep




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



RE: ERROR 500: javax.servlet.ServletException: Cannot retrieve definition for form bean

2006-05-07 Thread Pradyumna kumar, Jena \(J.\)
Hi,
Why are u naming ur form bean as LoginForm.do?? instead of LoginForm.
Keep both values of name attr in form bean and action tag same




 
 
Thanks
Pradyumna
 
-Original Message-
From: rajan pahuja [mailto:[EMAIL PROTECTED] 
Sent: Monday, May 08, 2006 9:34 AM
To: user@struts.apache.org
Subject: ERROR 500: javax.servlet.ServletException: Cannot retrieve
definition for form bean

Hi
I need your help.I have been getting this error for past 3 days and
i have not been able to trace the reason.
  
  i m gettin ERROR 500:
javax.servlet.ServletException: Cannot retrieve definition for form
bean LoginForm on action /doLogin
 
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageCont
extImpl.java:825)
 
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContex
tImpl.java:758)
org.apache.jsp.pages.login_jsp._jspService(login_jsp.java:96)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja
va:324)
 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
 
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.jav
a:1063)
 
org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(
RequestProcessor.java:1001)
 
org.apache.struts.action.RequestProcessor.processForward(RequestProcesso
r.java:560)
 
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:
209)
 
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


root cause

javax.servlet.jsp.JspException: Cannot retrieve definition for form
bean LoginForm on action /doLogin
org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:761)
  org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:443)
 
org.apache.jsp.pages.login_jsp._jspx_meth_html_form_0(login_jsp.java:146
)
 
org.apache.jsp.pages.login_jsp._jspx_meth_html_html_0(login_jsp.java:122
)
org.apache.jsp.pages.login_jsp._jspService(login_jsp.java:87)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja
va:324)
 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
 
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.jav
a:1063)
 
org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(
RequestProcessor.java:1001)
 
org.apache.struts.action.RequestProcessor.processForward(RequestProcesso
r.java:560)
 
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:
209)
 
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

Struts-Config.xml:




..














  












LoginForm is:

package myproject1.com;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;

public class LoginForm extends ActionForm
{
private String name=null;
private String password=null;

public   void reset(ActionMapping mapping, HttpServletRequest
request) {
this.name=null;
this.password=null;

}

public ActionErrors validate(
ActionMapping mapping, HttpServletRequest request ) {
ActionErrors errors = new ActionErrors();

if( getName() == null || getName().length() < 1 ) {
errors.add("name",new ActionMessage("error.name.required"));
}
if( getPassword() == null || getPassword().length() < 1 ) {
errors.add("password",new ActionMessage("error.password.required"));
}
return errors;
}

public String getName() {
return name;
}

public String getPassword() {
return password;
}

public void setName(String name) {
this.name = name;
}

public void setPassword(String password) {
this.p

RE: ERROR 500: javax.servlet.ServletException: Cannot retrieve definition for form bean

2006-05-07 Thread David G. Friedman
Rajan,

Your form name "LoginForm.do" and the action's form name of "LoginForm" do not 
match exactly.  I recommend you change
your form-bean from:
I expect the ".do you added to your form-bean name to be the problem:



to:



Regards,
David

-Original Message-
From: rajan pahuja [mailto:[EMAIL PROTECTED]
Sent: Monday, May 08, 2006 12:04 AM
To: user@struts.apache.org
Subject: ERROR 500: javax.servlet.ServletException: Cannot retrieve
definition for form bean


Hi
I need your help.I have been getting this error for past 3 days and i have 
not been able to trace the reason.

  i m gettin ERROR 500:
javax.servlet.ServletException: Cannot retrieve definition for form bean 
LoginForm on action /doLogin

org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)

org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
org.apache.jsp.pages.login_jsp._jspService(login_jsp.java:96)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1063)

org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(RequestProcessor.java:1001)

org.apache.struts.action.RequestProcessor.processForward(RequestProcessor.java:560)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:209)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


root cause

javax.servlet.jsp.JspException: Cannot retrieve definition for form bean 
LoginForm on action /doLogin
org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:761)
  org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:443)
org.apache.jsp.pages.login_jsp._jspx_meth_html_form_0(login_jsp.java:146)
org.apache.jsp.pages.login_jsp._jspx_meth_html_html_0(login_jsp.java:122)
org.apache.jsp.pages.login_jsp._jspService(login_jsp.java:87)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1063)

org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(RequestProcessor.java:1001)
  
org.apache.struts.action.RequestProcessor.processForward(RequestProcessor.java:560)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:209)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

Struts-Config.xml:




..



























LoginForm is:

package myproject1.com;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;

public class LoginForm extends ActionForm
{
private String name=null;
private String password=null;

public   void reset(ActionMapping mapping, HttpServletRequest request) {
this.name=null;
this.password=null;

}

public ActionErrors validate(
ActionMapping mapping, HttpServletRequest request ) {
ActionErrors errors = new ActionErrors();

if( getName() == null || getName().length() < 1 ) {
errors.add("name",new ActionMessage("error.name.required"));
}
if( getPassword() == null || getPassword().length() < 1 ) {
errors.add("password",new ActionMessage("error.password.required"));
}
return errors;
}

public String getName() {
return name;
}

public String getPassword() {
return password;
}

public void setName(String name) {
this.name = name;
}

public void setPassword(String password) {
this.password = password;
  

ERROR 500: javax.servlet.ServletException: Cannot retrieve definition for form bean

2006-05-07 Thread rajan pahuja
Hi
I need your help.I have been getting this error for past 3 days and i have 
not been able to trace the reason.
  
  i m gettin ERROR 500:
javax.servlet.ServletException: Cannot retrieve definition for form bean 
LoginForm on action /doLogin

org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)

org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
org.apache.jsp.pages.login_jsp._jspService(login_jsp.java:96)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1063)

org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(RequestProcessor.java:1001)

org.apache.struts.action.RequestProcessor.processForward(RequestProcessor.java:560)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:209)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


root cause

javax.servlet.jsp.JspException: Cannot retrieve definition for form bean 
LoginForm on action /doLogin
org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:761)
  org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:443)
org.apache.jsp.pages.login_jsp._jspx_meth_html_form_0(login_jsp.java:146)
org.apache.jsp.pages.login_jsp._jspx_meth_html_html_0(login_jsp.java:122)
org.apache.jsp.pages.login_jsp._jspService(login_jsp.java:87)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1063)

org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(RequestProcessor.java:1001)
  
org.apache.struts.action.RequestProcessor.processForward(RequestProcessor.java:560)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:209)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

Struts-Config.xml:




..














  












LoginForm is:

package myproject1.com;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;

public class LoginForm extends ActionForm
{
private String name=null;
private String password=null;

public   void reset(ActionMapping mapping, HttpServletRequest request) {
this.name=null;
this.password=null;

}

public ActionErrors validate(
ActionMapping mapping, HttpServletRequest request ) {
ActionErrors errors = new ActionErrors();

if( getName() == null || getName().length() < 1 ) {
errors.add("name",new ActionMessage("error.name.required"));
}
if( getPassword() == null || getPassword().length() < 1 ) {
errors.add("password",new ActionMessage("error.password.required"));
}
return errors;
}

public String getName() {
return name;
}

public String getPassword() {
return password;
}

public void setName(String name) {
this.name = name;
}

public void setPassword(String password) {
this.password = password;
}

LoginAction Class is:


package   myproject1.com;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import javax.sql.DataSource;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionFo

RE: page validation in wizzard app

2006-05-07 Thread Quinn Stone
You can use the flow:

POPULATE1-> JSP1 -> ACTION1 -> POPULATE2 -> JSP2 -> ACTION2 -> POPULATE3 -> JSP3

All of the POPULATE actions have "validate=false" in the config. So, if
validation fails after JSP2 is submitted, it forwards to POPULATE2 (ACTION2 has
input="POPULATE2" set), which won't try to validate. It makes for more (2x!)
actions, but also groups actions logically. POPULATE2 gets things ready for
JSP2, and ACTION2 does something with the form from JSP2, and doesn't care about
JSP3 at all. That way, you can move the xxx2 page somewhere else, and just have
to change the mapping in the config (assuming they're not named 1, 2, 3, that
could get a little confusing).

Not sure you'd want to change things at this point, but that's one way to
approach the problem.

Q

> -Original Message-
> From: Jakub Milkiewicz [mailto:[EMAIL PROTECTED] 
> Sent: Sunday, May 07, 2006 2:14 PM
> To: Struts Users Mailing List
> Subject: Re: page validation in wizzard app
> 
> 
> Hi Richard.
> I can't because of autovalidation. Remember that all my 
> action have the same
> actionForm which is storred in session.
> If validation fails i am forwarded to previous action but 
> this action is not
> even executed cause before this previous action can be 
> invoked validation
> process occurs. Page parameter isn't changed and validation 
> process fails
> again...
> If validation fails i do not enter any action's execute() method.
> 
> 2006/5/7, Richard Yee <[EMAIL PROTECTED]>:
> >
> > Jakub,
> > Why can't you reset the page attribute to the appropriate 
> value in your
> > Action classes when validation fails.
> >
> > -Richard
> >
> > Richard Yee wrote:
> > > Jakub,
> > > I think the more elegant solution is to do the validations in the
> > > ActionForm validate method and also use a hidden static  'page'
> > > variable in the JSP. Your Action.execute method should be 
> fairly small
> > > and mainly have code that calls business delegates and 
> that necessary
> > > for determining where to forward to.
> > >
> > > -Richard
> > >
> > >
> > > Jakub Milkiewicz wrote:
> > >> Hi
> > >> I have a wizzard application with 5 screens. All user inputs are
> > >> collected
> > >> in one bean, which is named: viewBean and is stored in 
> HTTP session.
> > >> So each action has the same formBean - viewBean.
> > >> I use commons-validator and viewBean properties to validate are
> > >> present in
> > >> validation.xml with page attributes.
> > >> ViewBean extends ValidatorForm and it's validation occurs
> > >> automatically - i
> > >> have validation set to true for all ACTIONS.
> > >> The structure of my app is:
> > >> Populate view  -> jsp ->populate view ->jsp ->populate 
> view -> jsp ...
> > >> Population of view happens in ACTION class and can consists of
> > >> retrieving
> > >> some data from DB, sets these data in HTTP request.
> > >> After population process i forward to appropriate jsp to 
> give user a
> > >> chance
> > >> to fill the form and to present population process results as for
> > >> example
> > >> options in .
> > >> If form is correct i go to another action which populate 
> view for a
> > next
> > >> screen (jsp).
> > >> If form is not filled correctly i need to show it again, 
> but i can not
> > >> forward to jsp - i need to forward to action that 
> prepares the form -
> > >> that's
> > >> why i have my input parameter of  tag set to action which
> > >> populate
> > >> the view - previous action.
> > >> I have a problem with page attribute. Please take a look at the
> > >> sample of
> > >> processing in my app:
> > >> ACTION1 -> JSP1 ->ACTION2 -> JSP2  ->Action3 ->JSP3 ...
> > >> Let's assume that user submits form in JSP2 to action3. After
> > ActionForm
> > >> bean population, page property is set to 2. Next, 
> validation fails in
> > >> Action3 and input parameter of  forwards user 
> to ACTION2.
> > >> Before execute method in Action2 is invoked, ActionForm 
> (viewBean)
> > >> validation occurs. The page attribute is still set to 2 ! and
> > >> commons-validator tries to validate properties that has page
> > >> attribute set
> > >> to 2.Obviously validation fails and control is forwarded 
> to Action1.
> > >> Action1
> > >> also has validation set to true and validation of 
> ActionForm occurs
> > >> again
> > >> with page =2.
> > >> Validation fails and control is forwarded to ...
> > >> Does anyone have any idea to solve the problem.
> > >> My idea is to not to use hidden page parameter in each 
> jsp action but
> > >> set
> > >> page property of viewBean in each Action: for ACTION2 sets it to
> > 2,  for
> > >> Action3 sets it to 3 ...
> > >> and to override validate method in viewBean:
> > >>
> > >> public ActionErrors validate(
> > >>ActionMapping mapping,
> > >>HttpServletRequest request) {
> > >>ActionErrors errors = super.validate(mapping,request);
> > >>if(errors != null && errors.size() > 0 )
> > >>   page--;
> > >>return errors;
> > >> }

Validation Problems

2006-05-07 Thread Sandeep Dhanuka

Hi Everyone,

I am using struts validatior to valiate my form on JSP and dont want to take
validation to my Action class.

I have a check box and a text box on my JSP. I want to validate text box to
have 19 characters when check box is not checked and 17 characters when
checkbox is checked.

How should I go about solving the problem using "validwhen".


Regards
Sandeep


Re: Issue with checkboxes!

2006-05-07 Thread Richard Yee

Rizwan,
Have you tried using a source level debugger to watch the value of the 
boolean in the reset method?


You should also view the source of your page to make sure the checkbox 
has the right name.


-Richard


Rizwan Merchant wrote:


Thanks Rick.
I have 6 checkboxes in that session scope form and 5 of them behave 
fine (I can set or unset them), only one of them acts funny and cannot 
be reset to false.


Any idea why this would be happening..just curious!

Rick Reumann wrote:

Rizwan Merchant wrote:

and in ExtendedDynaValidatorForm I would have a reset() method as 
follows


public void reset(ActionMapping mapping, HttpServletRequest request){
   super.reset();
   //not sure what goes here
}

So my next question is..how to I reset all the booleans in the form? 
Do I have to explicitly reset each of them, or is there a generic 
way to iterate through all of them and reset them? If possible, can 
I see some sample code please?


The code above is correct. I just manually set them to false..

public void reset(ActionMapping mapping, HttpServletRequest request){
myBoolProperty = false;
myOtherBoolProperty = false;
super.reset();

  }

I suppose if you had a ton of boolean properties you could do some 
sort of reflection to look for booleans and set them to false, but I 
haven't bothered with that.


Also remember, you only need to do this if your ActionForm has 
session scope.





-
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: page validation in wizzard app

2006-05-07 Thread Richard Yee

Jakub,
Even though you are using autovalidation, don't you still have a 
validate() method in your ActionForm that is getting called? Can you 
alter the page attribute appropriately there (ie. if (errors.size() > 0) 
page--;



-Richard
Jakub Milkiewicz wrote:

Hi Richard.
I can't because of autovalidation. Remember that all my action have 
the same

actionForm which is storred in session.
If validation fails i am forwarded to previous action but this action 
is not

even executed cause before this previous action can be invoked validation
process occurs. Page parameter isn't changed and validation process fails
again...
If validation fails i do not enter any action's execute() method.

2006/5/7, Richard Yee <[EMAIL PROTECTED]>:


Jakub,
Why can't you reset the page attribute to the appropriate value in your
Action classes when validation fails.

-Richard

Richard Yee wrote:
> Jakub,
> I think the more elegant solution is to do the validations in the
> ActionForm validate method and also use a hidden static  'page'
> variable in the JSP. Your Action.execute method should be fairly small
> and mainly have code that calls business delegates and that necessary
> for determining where to forward to.
>
> -Richard
>
>
> Jakub Milkiewicz wrote:
>> Hi
>> I have a wizzard application with 5 screens. All user inputs are
>> collected
>> in one bean, which is named: viewBean and is stored in HTTP session.
>> So each action has the same formBean - viewBean.
>> I use commons-validator and viewBean properties to validate are
>> present in
>> validation.xml with page attributes.
>> ViewBean extends ValidatorForm and it's validation occurs
>> automatically - i
>> have validation set to true for all ACTIONS.
>> The structure of my app is:
>> Populate view  -> jsp ->populate view ->jsp ->populate view -> jsp 
...

>> Population of view happens in ACTION class and can consists of
>> retrieving
>> some data from DB, sets these data in HTTP request.
>> After population process i forward to appropriate jsp to give user a
>> chance
>> to fill the form and to present population process results as for
>> example
>> options in .
>> If form is correct i go to another action which populate view for a
next
>> screen (jsp).
>> If form is not filled correctly i need to show it again, but i can 
not

>> forward to jsp - i need to forward to action that prepares the form -
>> that's
>> why i have my input parameter of  tag set to action which
>> populate
>> the view - previous action.
>> I have a problem with page attribute. Please take a look at the
>> sample of
>> processing in my app:
>> ACTION1 -> JSP1 ->ACTION2 -> JSP2  ->Action3 ->JSP3 ...
>> Let's assume that user submits form in JSP2 to action3. After
ActionForm
>> bean population, page property is set to 2. Next, validation fails in
>> Action3 and input parameter of  forwards user to ACTION2.
>> Before execute method in Action2 is invoked, ActionForm (viewBean)
>> validation occurs. The page attribute is still set to 2 ! and
>> commons-validator tries to validate properties that has page
>> attribute set
>> to 2.Obviously validation fails and control is forwarded to Action1.
>> Action1
>> also has validation set to true and validation of ActionForm occurs
>> again
>> with page =2.
>> Validation fails and control is forwarded to ...
>> Does anyone have any idea to solve the problem.
>> My idea is to not to use hidden page parameter in each jsp action but
>> set
>> page property of viewBean in each Action: for ACTION2 sets it to
2,  for
>> Action3 sets it to 3 ...
>> and to override validate method in viewBean:
>>
>> public ActionErrors validate(
>>ActionMapping mapping,
>>HttpServletRequest request) {
>>ActionErrors errors = super.validate(mapping,request);
>>if(errors != null && errors.size() > 0 )
>>   page--;
>>return errors;
>> }
>>
>> Maybe someone knows more elegant solution, or maybe architecture of
>> my app
>> isn't valid.
>>
>
>
> -
> 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: page validation in wizzard app

2006-05-07 Thread Ed Griebel

On 5/7/06, Jakub Milkiewicz <[EMAIL PROTECTED]> wrote:

Hi
I do not catch it:

>  name="validation_failed" action="RepopulateAction"/>
>
I do not think this synax is ok.


The  is inside of a  block in your
struts-config.xml, the syntax is approximate and should be enough to
give you the idea.


The problem is that i use autovalidation.


Yes, I understand you want to use autovalidation, but if turn it off
and call form.validate() manually it's only a few additional lines in
your action classes and will save you a lot of headaches.

-ed

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



Insert into html based on passed URL paramter

2006-05-07 Thread Bryce Nesbitt
I have a tiles template:
 

Which is involved from titles-defs.xml:







On a jsp file

<%@ taglib uri="struts-bean" prefix="bean" %>
<%@ taglib uri="struts-html" prefix="html" %>
<%@ taglib uri="struts-logic" prefix="logic" %>
<%@ taglib uri="struts-tiles" prefix="tiles" %>
<%@ taglib prefix="c" uri="c" %>
<%@ taglib prefix="x" uri="x" %>
<%
String contextPath = request.getContextPath();
%>

c:set var="area">
  
SF

  


...


But what I'd like to do is set the  of the HTML page, based on
the parsed URL parameter (e.g. area=987).  The proper title is not known
until the jsp executes, and does a lookup on an xml file.  Is this
possible with tiles?  How would one do it?

-- 

Visit http://www.obviously.com/



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



Re: Issue with checkboxes!

2006-05-07 Thread Rizwan Merchant


Thanks Rick.
I have 6 checkboxes in that session scope form and 5 of them behave fine 
(I can set or unset them), only one of them acts funny and cannot be 
reset to false.


Any idea why this would be happening..just curious!

Rick Reumann wrote:

Rizwan Merchant wrote:

and in ExtendedDynaValidatorForm I would have a reset() method as 
follows


public void reset(ActionMapping mapping, HttpServletRequest request){
   super.reset();
   //not sure what goes here
}

So my next question is..how to I reset all the booleans in the form? 
Do I have to explicitly reset each of them, or is there a generic way 
to iterate through all of them and reset them? If possible, can I see 
some sample code please?


The code above is correct. I just manually set them to false..

public void reset(ActionMapping mapping, HttpServletRequest request){
myBoolProperty = false;
myOtherBoolProperty = false;
super.reset();

  }

I suppose if you had a ton of boolean properties you could do some 
sort of reflection to look for booleans and set them to false, but I 
haven't bothered with that.


Also remember, you only need to do this if your ActionForm has session 
scope.





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



Re: Issue with checkboxes!

2006-05-07 Thread Rick Reumann

Rizwan Merchant wrote:


and in ExtendedDynaValidatorForm I would have a reset() method as follows

public void reset(ActionMapping mapping, HttpServletRequest request){
   super.reset();
   //not sure what goes here
}

So my next question is..how to I reset all the booleans in the form? Do 
I have to explicitly reset each of them, or is there a generic way to 
iterate through all of them and reset them? If possible, can I see some 
sample code please?


The code above is correct. I just manually set them to false..

public void reset(ActionMapping mapping, HttpServletRequest request){
myBoolProperty = false;
myOtherBoolProperty = false;
super.reset();

  }

I suppose if you had a ton of boolean properties you could do some sort 
of reflection to look for booleans and set them to false, but I haven't 
bothered with that.


Also remember, you only need to do this if your ActionForm has session 
scope.


--
Rick

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



Re: page validation in wizzard app

2006-05-07 Thread Jakub Milkiewicz

Hi Richard.
I can't because of autovalidation. Remember that all my action have the same
actionForm which is storred in session.
If validation fails i am forwarded to previous action but this action is not
even executed cause before this previous action can be invoked validation
process occurs. Page parameter isn't changed and validation process fails
again...
If validation fails i do not enter any action's execute() method.

2006/5/7, Richard Yee <[EMAIL PROTECTED]>:


Jakub,
Why can't you reset the page attribute to the appropriate value in your
Action classes when validation fails.

-Richard

Richard Yee wrote:
> Jakub,
> I think the more elegant solution is to do the validations in the
> ActionForm validate method and also use a hidden static  'page'
> variable in the JSP. Your Action.execute method should be fairly small
> and mainly have code that calls business delegates and that necessary
> for determining where to forward to.
>
> -Richard
>
>
> Jakub Milkiewicz wrote:
>> Hi
>> I have a wizzard application with 5 screens. All user inputs are
>> collected
>> in one bean, which is named: viewBean and is stored in HTTP session.
>> So each action has the same formBean - viewBean.
>> I use commons-validator and viewBean properties to validate are
>> present in
>> validation.xml with page attributes.
>> ViewBean extends ValidatorForm and it's validation occurs
>> automatically - i
>> have validation set to true for all ACTIONS.
>> The structure of my app is:
>> Populate view  -> jsp ->populate view ->jsp ->populate view -> jsp ...
>> Population of view happens in ACTION class and can consists of
>> retrieving
>> some data from DB, sets these data in HTTP request.
>> After population process i forward to appropriate jsp to give user a
>> chance
>> to fill the form and to present population process results as for
>> example
>> options in .
>> If form is correct i go to another action which populate view for a
next
>> screen (jsp).
>> If form is not filled correctly i need to show it again, but i can not
>> forward to jsp - i need to forward to action that prepares the form -
>> that's
>> why i have my input parameter of  tag set to action which
>> populate
>> the view - previous action.
>> I have a problem with page attribute. Please take a look at the
>> sample of
>> processing in my app:
>> ACTION1 -> JSP1 ->ACTION2 -> JSP2  ->Action3 ->JSP3 ...
>> Let's assume that user submits form in JSP2 to action3. After
ActionForm
>> bean population, page property is set to 2. Next, validation fails in
>> Action3 and input parameter of  forwards user to ACTION2.
>> Before execute method in Action2 is invoked, ActionForm (viewBean)
>> validation occurs. The page attribute is still set to 2 ! and
>> commons-validator tries to validate properties that has page
>> attribute set
>> to 2.Obviously validation fails and control is forwarded to Action1.
>> Action1
>> also has validation set to true and validation of ActionForm occurs
>> again
>> with page =2.
>> Validation fails and control is forwarded to ...
>> Does anyone have any idea to solve the problem.
>> My idea is to not to use hidden page parameter in each jsp action but
>> set
>> page property of viewBean in each Action: for ACTION2 sets it to
2,  for
>> Action3 sets it to 3 ...
>> and to override validate method in viewBean:
>>
>> public ActionErrors validate(
>>ActionMapping mapping,
>>HttpServletRequest request) {
>>ActionErrors errors = super.validate(mapping,request);
>>if(errors != null && errors.size() > 0 )
>>   page--;
>>return errors;
>> }
>>
>> Maybe someone knows more elegant solution, or maybe architecture of
>> my app
>> isn't valid.
>>
>
>
> -
> 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: page validation in wizzard app

2006-05-07 Thread Jakub Milkiewicz

Hi
I do not catch it:





I do not think this synax is ok.
The problem is that i use autovalidation.
If validation fails i am forwarded to another action specified by input
attribute.Let's call it action2.
But  action2  is never executed because before its execute() method is
invoked.Form bean is validated again.
Page attribute isn't changed so validation fails and i am forwarded to
another action ...
That's like this chain go.
If i turn off autovalidation i will follow your idea.
2006/5/7, Ed Griebel <[EMAIL PROTECTED]>:


You could have the ActionForward mapped to an Action class in your
struts_config.xml file just as easily as a JSP, e.g.  and then just
'return ActionForward("validation_failed")' if validation failed on
page1.

HTH,
-ed

On 5/6/06, Jakub Milkiewicz <[EMAIL PROTECTED]> wrote:
> Hi Ed
> Thanks for an answer. The problem with your idea is:
> IF validation fails i can not forward to previous JSP!
> I need to forward to previous action to prepare me a view - retireve
> something from DB and put it in .
> I have the same idea to put form.setPage(pageNo) as first thing in each
> action. Moreover if i disable autovalidation
> i do not have to make those tricks to decrement page in validate if
errors
> are found.
>
> 2006/5/6, Ed Griebel <[EMAIL PROTECTED]>:
> >
> > Hi Jakub-
> >
> > I'm not sure if I fully understand your pageflow, but here goes. I
> > would turn off automatic validation in struts_config.xml. In each
> > action, one of the first things I would do is call
> > form.setPage(pageNo) and then call form.validate(...), and if there
> > are any errors I'd return an ActionForward corresponding to the
> > previous JSP. I have an app that is very similar to this but I use a
> > DispatchAction and set things as described above and it works well.
> >
> > As to overriding the page variable counter, it's an interesting idea,
> > but you may run into a problem so you'll have to trap it from going
> > below zero, for instance if they keep failing validation on the first
> > screen. One way to find out for sure is to try it out and see how it
> > goes!
> >
> > -ed
> >
> > On 5/6/06, Jakub Milkiewicz <[EMAIL PROTECTED]> wrote:
> > > Hi
> > > I have a wizzard application with 5 screens. All user inputs are
> > collected
> > > in one bean, which is named: viewBean and is stored in HTTP session.
> > > So each action has the same formBean - viewBean.
> > > I use commons-validator and viewBean properties to validate are
present
> > in
> > > validation.xml with page attributes.
> > > ViewBean extends ValidatorForm and it's validation occurs
automatically
> > - i
> > > have validation set to true for all ACTIONS.
> > > The structure of my app is:
> > > Populate view  -> jsp ->populate view ->jsp ->populate view -> jsp
...
> > > Population of view happens in ACTION class and can consists of
> > retrieving
> > > some data from DB, sets these data in HTTP request.
> > > After population process i forward to appropriate jsp to give user a
> > chance
> > > to fill the form and to present population process results as for
> > example
> > > options in .
> > > If form is correct i go to another action which populate view for a
next
> > > screen (jsp).
> > > If form is not filled correctly i need to show it again, but i can
not
> > > forward to jsp - i need to forward to action that prepares the form
-
> > that's
> > > why i have my input parameter of  tag set to action which
> > populate
> > > the view - previous action.
> > > I have a problem with page attribute. Please take a look at the
sample
> > of
> > > processing in my app:
> > > ACTION1 -> JSP1 ->ACTION2 -> JSP2  ->Action3 ->JSP3 ...
> > > Let's assume that user submits form in JSP2 to action3. After
ActionForm
> > > bean population, page property is set to 2. Next, validation fails
in
> > > Action3 and input parameter of  forwards user to ACTION2.
> > > Before execute method in Action2 is invoked, ActionForm (viewBean)
> > > validation occurs. The page attribute is still set to 2 ! and
> > > commons-validator tries to validate properties that has page
attribute
> > set
> > > to 2.Obviously validation fails and control is forwarded to Action1.
> > Action1
> > > also has validation set to true and validation of ActionForm occurs
> > again
> > > with page =2.
> > > Validation fails and control is forwarded to ...
> > > Does anyone have any idea to solve the problem.
> > > My idea is to not to use hidden page parameter in each jsp action
but
> > set
> > > page property of viewBean in each Action: for ACTION2 sets it to
2,  for
> > > Action3 sets it to 3 ...
> > > and to override validate method in viewBean:
> > >
> > > public ActionErrors validate(
> > > ActionMapping mapping,
> > > HttpServletRequest request) {
> > > ActionErrors errors = super.validate(mapping,request);
> > > if(errors != null && errors.size() > 0 )
> > >page--;
> > > return errors;
> > > }
> > >
> > > Maybe someone knows more ele

Re: page validation in wizzard app

2006-05-07 Thread Richard Yee

Jakub,
Why can't you reset the page attribute to the appropriate value in your 
Action classes when validation fails.


-Richard

Richard Yee wrote:

Jakub,
I think the more elegant solution is to do the validations in the 
ActionForm validate method and also use a hidden static  'page' 
variable in the JSP. Your Action.execute method should be fairly small 
and mainly have code that calls business delegates and that necessary 
for determining where to forward to.


-Richard


Jakub Milkiewicz wrote:

Hi
I have a wizzard application with 5 screens. All user inputs are 
collected

in one bean, which is named: viewBean and is stored in HTTP session.
So each action has the same formBean - viewBean.
I use commons-validator and viewBean properties to validate are 
present in

validation.xml with page attributes.
ViewBean extends ValidatorForm and it's validation occurs 
automatically - i

have validation set to true for all ACTIONS.
The structure of my app is:
Populate view  -> jsp ->populate view ->jsp ->populate view -> jsp ...
Population of view happens in ACTION class and can consists of 
retrieving

some data from DB, sets these data in HTTP request.
After population process i forward to appropriate jsp to give user a 
chance
to fill the form and to present population process results as for 
example

options in .
If form is correct i go to another action which populate view for a next
screen (jsp).
If form is not filled correctly i need to show it again, but i can not
forward to jsp - i need to forward to action that prepares the form - 
that's
why i have my input parameter of  tag set to action which 
populate

the view - previous action.
I have a problem with page attribute. Please take a look at the 
sample of

processing in my app:
ACTION1 -> JSP1 ->ACTION2 -> JSP2  ->Action3 ->JSP3 ...
Let's assume that user submits form in JSP2 to action3. After ActionForm
bean population, page property is set to 2. Next, validation fails in
Action3 and input parameter of  forwards user to ACTION2.
Before execute method in Action2 is invoked, ActionForm (viewBean)
validation occurs. The page attribute is still set to 2 ! and
commons-validator tries to validate properties that has page 
attribute set
to 2.Obviously validation fails and control is forwarded to Action1. 
Action1
also has validation set to true and validation of ActionForm occurs 
again

with page =2.
Validation fails and control is forwarded to ...
Does anyone have any idea to solve the problem.
My idea is to not to use hidden page parameter in each jsp action but 
set

page property of viewBean in each Action: for ACTION2 sets it to 2,  for
Action3 sets it to 3 ...
and to override validate method in viewBean:

public ActionErrors validate(
   ActionMapping mapping,
   HttpServletRequest request) {
   ActionErrors errors = super.validate(mapping,request);
   if(errors != null && errors.size() > 0 )
  page--;
   return errors;
}

Maybe someone knows more elegant solution, or maybe architecture of 
my app

isn't valid.




-
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: page validation in wizzard app

2006-05-07 Thread Ed Griebel

You could have the ActionForward mapped to an Action class in your
struts_config.xml file just as easily as a JSP, e.g.  and then just
'return ActionForward("validation_failed")' if validation failed on
page1.

HTH,
-ed

On 5/6/06, Jakub Milkiewicz <[EMAIL PROTECTED]> wrote:

Hi Ed
Thanks for an answer. The problem with your idea is:
IF validation fails i can not forward to previous JSP!
I need to forward to previous action to prepare me a view - retireve
something from DB and put it in .
I have the same idea to put form.setPage(pageNo) as first thing in each
action. Moreover if i disable autovalidation
i do not have to make those tricks to decrement page in validate if errors
are found.

2006/5/6, Ed Griebel <[EMAIL PROTECTED]>:
>
> Hi Jakub-
>
> I'm not sure if I fully understand your pageflow, but here goes. I
> would turn off automatic validation in struts_config.xml. In each
> action, one of the first things I would do is call
> form.setPage(pageNo) and then call form.validate(...), and if there
> are any errors I'd return an ActionForward corresponding to the
> previous JSP. I have an app that is very similar to this but I use a
> DispatchAction and set things as described above and it works well.
>
> As to overriding the page variable counter, it's an interesting idea,
> but you may run into a problem so you'll have to trap it from going
> below zero, for instance if they keep failing validation on the first
> screen. One way to find out for sure is to try it out and see how it
> goes!
>
> -ed
>
> On 5/6/06, Jakub Milkiewicz <[EMAIL PROTECTED]> wrote:
> > Hi
> > I have a wizzard application with 5 screens. All user inputs are
> collected
> > in one bean, which is named: viewBean and is stored in HTTP session.
> > So each action has the same formBean - viewBean.
> > I use commons-validator and viewBean properties to validate are present
> in
> > validation.xml with page attributes.
> > ViewBean extends ValidatorForm and it's validation occurs automatically
> - i
> > have validation set to true for all ACTIONS.
> > The structure of my app is:
> > Populate view  -> jsp ->populate view ->jsp ->populate view -> jsp ...
> > Population of view happens in ACTION class and can consists of
> retrieving
> > some data from DB, sets these data in HTTP request.
> > After population process i forward to appropriate jsp to give user a
> chance
> > to fill the form and to present population process results as for
> example
> > options in .
> > If form is correct i go to another action which populate view for a next
> > screen (jsp).
> > If form is not filled correctly i need to show it again, but i can not
> > forward to jsp - i need to forward to action that prepares the form -
> that's
> > why i have my input parameter of  tag set to action which
> populate
> > the view - previous action.
> > I have a problem with page attribute. Please take a look at the sample
> of
> > processing in my app:
> > ACTION1 -> JSP1 ->ACTION2 -> JSP2  ->Action3 ->JSP3 ...
> > Let's assume that user submits form in JSP2 to action3. After ActionForm
> > bean population, page property is set to 2. Next, validation fails in
> > Action3 and input parameter of  forwards user to ACTION2.
> > Before execute method in Action2 is invoked, ActionForm (viewBean)
> > validation occurs. The page attribute is still set to 2 ! and
> > commons-validator tries to validate properties that has page attribute
> set
> > to 2.Obviously validation fails and control is forwarded to Action1.
> Action1
> > also has validation set to true and validation of ActionForm occurs
> again
> > with page =2.
> > Validation fails and control is forwarded to ...
> > Does anyone have any idea to solve the problem.
> > My idea is to not to use hidden page parameter in each jsp action but
> set
> > page property of viewBean in each Action: for ACTION2 sets it to 2,  for
> > Action3 sets it to 3 ...
> > and to override validate method in viewBean:
> >
> > public ActionErrors validate(
> > ActionMapping mapping,
> > HttpServletRequest request) {
> > ActionErrors errors = super.validate(mapping,request);
> > if(errors != null && errors.size() > 0 )
> >page--;
> > return errors;
> > }
> >
> > Maybe someone knows more elegant solution, or maybe architecture of my
> app
> > isn't valid.
> >
> >
>
> -
> 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: Issue with checkboxes!

2006-05-07 Thread Rizwan Merchant


Thanks for the responses guys! Please see end of message for follow up 
question :)


So I get most of what you said about overriding the ActionForm. Since I 
am using DynaValidatorForm I will need to extend that class.

Currently my form-bean definition is as follows
   type="org.apache.struts.validator.DynaValidatorForm">

   
   type="com.cwsi.eshipper.model.UserRestrictions"/>
   type="com.cwsi.eshipper.model.Customer"/>
   type="com.cwsi.eshipper.model.CreditCard"/>

   

That would change to

   type="com.mycompany.mydomain.form.ExtendedDynaValidatorForm">

   
   type="com.cwsi.eshipper.model.UserRestrictions"/>
   type="com.cwsi.eshipper.model.Customer"/>
   type="com.cwsi.eshipper.model.CreditCard"/>

   

and in ExtendedDynaValidatorForm I would have a reset() method as follows

public void reset(ActionMapping mapping, HttpServletRequest request){
   super.reset();
   //not sure what goes here
}

So my next question is..how to I reset all the booleans in the form? Do 
I have to explicitly reset each of them, or is there a generic way to 
iterate through all of them and reset them? If possible, can I see some 
sample code please?


Thanks again!

-Riz.

Rick Reumann wrote:

王曾wang_zeng wrote:
The reason is that the form bean is configed to be saved in session 
scope,

and the reset() method is not called when the form is submitted.


Rizwan,

Meaning... you need to override the ActionForm reset method and set 
any of your ActionForm booleans to false. Then you'll be all set. 
(Remember in http, only true checkboxes values are sent with the 
Request so if your backing ActionForm has session scope and some were 
already true, there is nothing to set it to false - which is why you 
need the reset method for session-scoped form beans and boolean values.





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



Re: Issue with checkboxes!

2006-05-07 Thread Rick Reumann

王曾wang_zeng wrote:

The reason is that the form bean is configed to be saved in session scope,
and the reset() method is not called when the form is submitted.


Rizwan,

Meaning... you need to override the ActionForm reset method and set any 
of your ActionForm booleans to false. Then you'll be all set. (Remember 
in http, only true checkboxes values are sent with the Request so if 
your backing ActionForm has session scope and some were already true, 
there is nothing to set it to false - which is why you need the reset 
method for session-scoped form beans and boolean values.


--
Rick


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



Re: Shale's dialog manager is driving me nuts!

2006-05-07 Thread Martin Gainty

Good Morning Sander-

I found Log4j supports multiple implementations to log event activities
Information and binaries are available at
http://logging.apache.org/log4j/docs/

(2 cents from the wolf pack)
Sverige Altid

Martin Gainty

__
Disclaimer and confidentiality note
Everything in this e-mail and any attachments relates to the official 
business of Sender. This transmission is of a confidential nature and Sender 
does not endorse distribution to any party other than intended recipient. 
Sender does not necessarily endorse content contained within this 
transmission.

(mobile) 001-603-438-5053






From: "Craig McClanahan" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" 
To: "Struts Users Mailing List" 
Subject: Re: Shale's dialog manager is driving me nuts!
Date: Sat, 6 May 2006 12:48:23 -0700
MIME-Version: 1.0
Received: from mail.apache.org ([209.237.227.199]) by 
bay0-mc5-f18.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.1830); Sat, 6 
May 2006 12:48:55 -0700

Received: (qmail 34033 invoked by uid 500); 6 May 2006 19:48:45 -
Received: (qmail 34022 invoked by uid 99); 6 May 2006 19:48:45 -
Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49)by 
apache.org (qpsmtpd/0.29) with ESMTP; Sat, 06 May 2006 12:48:45 -0700
Received: pass (asf.osuosl.org: domain of [EMAIL PROTECTED] designates 
64.233.184.228 as permitted sender)
Received: from [64.233.184.228] (HELO wr-out-0506.google.com) 
(64.233.184.228)by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 06 May 
2006 12:48:44 -0700
Received: by wr-out-0506.google.com with SMTP id i32so801404wrafor 
; Sat, 06 May 2006 12:48:24 -0700 (PDT)
Received: by 10.65.213.1 with SMTP id p1mr328162qbq;Sat, 06 May 
2006 12:48:23 -0700 (PDT)

Received: by 10.64.178.2 with HTTP; Sat, 6 May 2006 12:48:23 -0700 (PDT)
X-Message-Info: txF49lGdW402uzBp+db8Lbl/11SjFklbKnCZg9d+Eus=
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
Precedence: bulk
List-Unsubscribe: 
List-Help: 
List-Post: 
List-Id: "Struts Users Mailing List" 
Delivered-To: mailing list user@struts.apache.org
X-ASF-Spam-Status: No, hits=0.0 required=10.0tests=HTML_MESSAGE,SPF_PASS
X-Spam-Check-By: apache.org
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;s=beta; 
d=gmail.com;
h=received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:references:x-google-sender-auth; 
   
b=UGP/mNYYcsKTIF7RSXGXj9LKBmyEA049tSELfAc9IakW/Swj4vFctcXHMjV1neAKIzApPqM9V5KbjRxiKeXoBvD2TriKQTz5/WFAvbil+gkz7KIVBqhVcj33M19F1fW4eIpDxiduop2dOwvAsHqRjvcbFHk3yGwvUz6SBAxDrjw=

References: <[EMAIL PROTECTED]>
X-Google-Sender-Auth: 66840ca01f882dc6
X-Virus-Checked: Checked by ClamAV on apache.org
Return-Path: [EMAIL PROTECTED]
X-OriginalArrivalTime: 06 May 2006 19:48:55.0985 (UTC) 
FILETIME=[1C1B7A10:01C67146]


On 5/6/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]>
wrote:


Hi,

I'm a software architect and we have a major project coming where I
thought our
dev team should try new things. So I decided to replace Struts (default
option
:P) with JSF and Shale. I thought that it would be good when I personally
know
the limits of JSF and Shale first before I put them into our proposal.
For this I've written a small app where the user has to input his personal
data
in wizard style (dialog) but somehow I cannot go further than the first
page
>:( No errors or exceptions or something but the first dialog screen 
keeps

opened again and again.
I tried to understand what goes on in the Shale's usecases example app
(the
login and profile creation is also a dialog) and mostly copy/pasted the
dialog-config.xml, the jsps and backing beans (I couldn't get the usecases
login part to run btw) but with no luck :'(


Then I thought my "lone wolf" time is up and I should go and ask someone
smarter
;)



Good plan :-).
One issue that often bites newbies to JSF (whether or not you use Shale) is
that the existence of any validation errors on a submitted page will cause
the input page to be redisplayed -- but if you have no way to see the error
messages, you don't know why that happened.  Try putting an 
component in your page (set to display all messages for all input fields)
and see if that helps.

Craig




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



Re: Issue with checkboxes!

2006-05-07 Thread 王曾wang_zeng

The reason is that the form bean is configed to be saved in session scope,
and the reset() method is not called when the form is submitted.



  





--
Wang Zeng


Re: SV: Shale's dialog manager is driving me nuts!

2006-05-07 Thread sander . vallaots
Quoting Hermod Opstvedt <[EMAIL PROTECTED]>:

> Hi
> 
> The bottom of the page might be a clue : 
> 
> id:"null" | type:"javax.faces.component.UIViewRoot"
> 
> Hermod
> 
> 
> -Opprinnelig melding-
> Fra: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> Sendt: 7. mai 2006 01:48
> Til: Struts Users Mailing List
> Emne: RE: Shale's dialog manager is driving me nuts!
> 
> Quoting [EMAIL PROTECTED]:
> 
> > Quoting "David G. Friedman" <[EMAIL PROTECTED]>:
> > 
> > > Sounds like you need (da da da) Faces Trace:
> > > http://www.jroller.com/page/cagataycivici?entry=rise_of_the_faces_trace
> > > 
> > > Okay, so I've never used it but it sounds like it might
> > > just help you figure out where, when and why your JSF + Shale
> > > application is stuck.
> > > 
> > > Regards,
> > > David
> > > 
> > 
> > 
> > OK.
> > 
> > Applied Faces Trace. Do you see anything suspicious here (see attachment)?
> > 
> > I'm too new to this. The snapshot was made after the "Next" button was
> > clicked.
> > 
> > rgds Sander
> > 
> 
> Hehjust found out that attachments are a big nono. Ummthe result
> page is
> here: http://www.hot.ee/sandervall/editPerson.html
> 
> rgds Sander
> 
> 
> 
> -
> 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]
> 
> 

YES

I think I figured it out !!!

It was a Tiles issue. In the main layout jsp I have a tag






and I also had 
 envelope around the content jsp (editPerson) body which was rendered as
the tiles "body" attribute.

Seems like you mustn't have it. After I removed the  tag the dialog
started working!!!

yeehaa :)

rgds Sander

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