Re: iteration with indexed properties

2006-04-24 Thread Adam Hardy
you need to have an instantiated array of wrapper[] that is big enough 
to take what your HTML submits. If your action form is in the request, 
then wrappers[] will be null unless you instantiate it.


martin on 23/04/06 16:59, wrote:

I've a problem with indexed properties inside an iteration. Some of the
properties are rendered as a text-area and should be editable by the
user. The rendering goes fine but if the user makes some changes, they
are not committed to the form. Please take a look at the jsp/html/java
snippets below.


[snip]

[jsp snippet]
logic:iterate id=wrapper indexId=wrapperIndex name=myForm
property=wrappers scope=session
 td class=
   html:text name=wrapper property=tip.scoreHome indexed=true
size=1 maxlength=2 /nbsp;:nbsp;
   html:text name=wrapper property=tip.scoreVisitor
indexed=true size=1 maxlength=2 /
 /td
/logic:iterate

[rendered html]
 td class=
   input type=text name=wrapper[2].tip.guessedScoreHome
maxlength=2 size=1 value=23nbsp;:nbsp;
   input type=text name=wrapper[2].tip.guessedScoreVisitor
maxlength=2 size=1 value=
 /td

[action form snippet]
   public void setWrappers(GameTipWrapper[] wrappers) {
   this.wrappers = wrappers;
   }

   public GameTipWrapper getWrapper(int index) {
   return wrappers[index];
   }

   public void setWrapper(int index, GameTipWrapper wrapper) {
   wrappers[index] = wrapper;
   }


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



Session without cookies

2006-04-24 Thread Chan Michael
Hi All,

I have been searching for hours and still cannot find
any useful info. Hope you can help.

I am building a Struts app. (Struts 1.2.4 + Tomcat 5.5
+ Apache 2.0.55 + Spring 1.2.6) and want to use
session without
enabling cookies. I use html:link to create links so
;jsessionid is appended to the end. Fine. The problem
I have is every time I access a page, a new session id
is created so essentially everything stored in session
is lost. Here is some output from my test action,
test.do:

test.do
=
HttpSession session = request.getSession();
System.out.println(Is session new?  +
session.isNew());
System.out.println(Session id:  + session.getId());

First access
=
Is session new? true
Session id: B9F9E135DCBAC90AB2B5AEBCE901FAA5

Second access
=
Is sesssion new? false
Session id: 8CCE7A388E76C0F56016E8F41E29E0E5

The session is not new but the id is different...I
already set in Tomcat server.xml

Context path=/myApp cookies=false...

What am I missing??

Thanks in advance.

Michael

___
 YM - 離線訊息
 就算你沒有上網,你的朋友仍可以留下訊息給你,當你上網時就能立即看到,任何說話都冇走失。
 http://messenger.yahoo.com.hk

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



Struts 1.2.9 does not throw InvalidCancelException

2006-04-24 Thread Lixin Chu
just upgraded from 1.2.8 to 1.2.9. I did not add

 set-property property=cancellable value=true/

in struts-config.xml and still use html:cancel as per normal in jsp files.
Tested, do not see exception and no validation is called.

any reason why ? default setting ?


btw, my action is LookupDispatchAction.

rgds
lixin


RE: Session without cookies

2006-04-24 Thread Chandra.Ravinithala
I think some where(may be in the action class association with the action 
/test.do) you are creating new session each time for each request. Most 
possible mistake could be using

Request.getSession(true);

See below documentation from Servlet Specifications
**
getSession()
public HttpSession getSession()
Returns the current session associated with this request, or if the 
request does not have a session, creates one.
Returns: the HttpSession associated with this request
See Also: getSession(boolean)

getSession(boolean)
public HttpSession getSession(boolean create)
Returns the current HttpSession associated with this request or, if if 
there is no current session and create is true, returns a new session. If 
create is false andthe request has no valid HttpSession, this method 
returns null.

To make sure the session is properly maintained, you must call this method 
before the response is committed. If the container is using cookies to maintain 
session integrity and is asked to create a new session when the response is 
committed, an IllegalStateException is thrown.

Parameters:
codetrue/code - to create a new session for this request if necessary; 
false to return null if there’s no current session Returns: the HttpSession 
associated with this request or null if create is false and the request has no 
valid session
See Also: getSession() 
**

Chandra
-Original Message-
From: Chan Michael [mailto:[EMAIL PROTECTED] 
Sent: Monday, April 24, 2006 2:48 PM
To: user@struts.apache.org
Subject: Session without cookies

Hi All,

I have been searching for hours and still cannot find any useful info. Hope you 
can help.

I am building a Struts app. (Struts 1.2.4 + Tomcat 5.5
+ Apache 2.0.55 + Spring 1.2.6) and want to use
session without
enabling cookies. I use html:link to create links so ;jsessionid is appended 
to the end. Fine. The problem I have is every time I access a page, a new 
session id is created so essentially everything stored in session is lost. Here 
is some output from my test action,
test.do:

test.do
=
HttpSession session = request.getSession(); System.out.println(Is session new? 
 + session.isNew()); System.out.println(Session id:  + session.getId());

First access
=
Is session new? true
Session id: B9F9E135DCBAC90AB2B5AEBCE901FAA5

Second access
=
Is sesssion new? false
Session id: 8CCE7A388E76C0F56016E8F41E29E0E5

The session is not new but the id is different...I already set in Tomcat 
server.xml

Context path=/myApp cookies=false...

What am I missing??

Thanks in advance.

Michael

___
 YM - �x息
 就算你�]有上�W,你的朋友仍可以留下��息�o你,��你上�W�r就能立即看到,任何�f��都�幼呤А�
 http://messenger.yahoo.com.hk

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



***** Passing an ArrayList to action from JSP ****

2006-04-24 Thread Sony Thomas

Hi Friends,

I have a dropdown list in my jsp created in the action. When I submit my 
jsp, Is there is any way to submit my arraylist as well?


Total workflow follows :

creating an arraylist of values to be displayed in the jsp in Action class.

When I submit the jsp the arrayList should resubmit to the Action class.

If anyone has any idea please put through.

thanks in advance

Sony

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



回覆: RE: Session without cookies

2006-04-24 Thread Chan Michael
Hi Chandra,

Thanks for your prompt reply.

I have checked many many times and I have 100% sure
there is no 

Request.getSession(true);

in all my action classes.

Thanks.

Michael

--- [EMAIL PROTECTED] :

 I think some where(may be in the action class
 association with the action /test.do) you are
 creating new session each time for each request.
 Most possible mistake could be using
 
 Request.getSession(true);
 
 See below documentation from Servlet Specifications

**
 getSession()
 public HttpSession getSession()
   Returns the current session associated with this
 request, or if the request does not have a session,
 creates one.
   Returns: the HttpSession associated with this
 request
 See Also: getSession(boolean)
 
 getSession(boolean)
 public HttpSession getSession(boolean create)
   Returns the current HttpSession associated with
 this request or, if if there is no current session
 and create is true, returns a new session. If create
 is false and  the request has no valid HttpSession,
 this method returns null.
 
 To make sure the session is properly maintained, you
 must call this method before the response is
 committed. If the container is using cookies to
 maintain session integrity and is asked to create a
 new session when the response is committed, an
 IllegalStateException is thrown.
 
 Parameters:
 codetrue/code - to create a new session for this
 request if necessary; false to return null if
 there*s no current session Returns: the HttpSession
 associated with this request or null if create is
 false and the request has no valid session
 See Also: getSession() 

**
 
 Chandra
 -Original Message-
 From: Chan Michael
 [mailto:[EMAIL PROTECTED] 
 Sent: Monday, April 24, 2006 2:48 PM
 To: user@struts.apache.org
 Subject: Session without cookies
 
 Hi All,
 
 I have been searching for hours and still cannot
 find any useful info. Hope you can help.
 
 I am building a Struts app. (Struts 1.2.4 + Tomcat
 5.5
 + Apache 2.0.55 + Spring 1.2.6) and want to use
 session without
 enabling cookies. I use html:link to create links
 so ;jsessionid is appended to the end. Fine. The
 problem I have is every time I access a page, a new
 session id is created so essentially everything
 stored in session is lost. Here is some output from
 my test action,
 test.do:
 
 test.do
 =
 HttpSession session = request.getSession();
 System.out.println(Is session new?  +
 session.isNew()); System.out.println(Session id: 
 + session.getId());
 
 First access
 =
 Is session new? true
 Session id: B9F9E135DCBAC90AB2B5AEBCE901FAA5
 
 Second access
 =
 Is sesssion new? false
 Session id: 8CCE7A388E76C0F56016E8F41E29E0E5
 
 The session is not new but the id is different...I
 already set in Tomcat server.xml
 
 Context path=/myApp cookies=false...
 
 What am I missing??
 
 Thanks in advance.
 
 Michael
 
 ___
  YM - 褩#65533;#65533;洘
 

憩呾斕�]衄奻鋒ㄛ斕腔攬衭゛褫眕隱狟#65533;洘緻斕ㄛ#65533;斕奻鋒�r憩夔蕾撈艘善ㄛ¦睡挲#65533;飲�衿萯均�
  http://messenger.yahoo.com.hk
 

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


___
 YM - 離線訊息
 就算你沒有上網,你的朋友仍可以留下訊息給你,當你上網時就能立即看到,任何說話都冇走失。
 http://messenger.yahoo.com.hk

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



StrutsTestCases

2006-04-24 Thread Chaitanya Parkhi
hi guys i hav created a java file by using MockObjectStrutsTestCases which
tests for a simple login form which takes Login Name  password as a
input.in this file i hav following method

public void testSuccessfulLogin() {

setConfigFile(/WEB-INF/struts-config.xml);

setRequestPathInfo(/login);
addRequestParameter(username,cdp);
addRequestParameter(password,[EMAIL PROTECTED]);

actionPerform();

String[] actionErrors = {username.required,password.required};
verifyActionErrors(actionErrors);
}

if i run the above test junit window shows that ther  r no errors,but shows
a warning that WB-INF\web.xml not found  does any1 knows why?


Re: ***** Passing an ArrayList to action from JSP ****

2006-04-24 Thread Li
Hi Pal,

You can save arraylist object in your session object container (if you have,
normally is a java bean), then you can pass through the arraylist object in
an active session.

Let's say you have a form called Form1 which is a action form,
inside the form, you can add an arraylist, so when you submit the form, the
arraylist will also be submitted to the server.

You probably also need create an entry in the session object container, so
that you can use it without calling through the form.

To get the arraylist value and display on jsp:
In your action class:
Extract arraylist values and save it to the object your created in the
session object container
then, update the session object container in the session.
In your jsp:
Call the session object and extract the arraylist object with its items (I
am sure you know how to do it)

To submit the arraylist and get it in your action class:
Since you have arraylist object within the form. once you submit the form,
the action form is passed to the action class.

In your action class:
Get the form from session, extract the arraylist and do something ...

Wish it could help ~

On 4/24/06, Sony Thomas [EMAIL PROTECTED] wrote:

 Hi Friends,

 I have a dropdown list in my jsp created in the action. When I submit my
 jsp, Is there is any way to submit my arraylist as well?

 Total workflow follows :

 creating an arraylist of values to be displayed in the jsp in Action
 class.

 When I submit the jsp the arrayList should resubmit to the Action class.

 If anyone has any idea please put through.

 thanks in advance

 Sony

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




--
=
The world will be ended if love is everywhere.
    Shawzi


StrutsTestCases

2006-04-24 Thread Chaitanya Parkhi
hi guys i hav created a java file by using MockObjectStrutsTestCases which
tests for a simple login form which takes Login Name  password as a
input.in this file i hav following method

public void testSuccessfulLogin() {

setConfigFile(/WEB-INF/struts-config.xml);

setRequestPathInfo(/login);
addRequestParameter(username,cdp);
addRequestParameter(password,[EMAIL PROTECTED]);

actionPerform();

String[] actionErrors = {username.required,password.required};
verifyActionErrors(actionErrors);
}

if i run the above test junit window shows that ther  r no errors,but shows
a warning that WB-INF\web.xml not found  does any1 knows why?


RE: RE: Session without cookies

2006-04-24 Thread Chan Michael
Hi Chandra,

As far as I know, the attribute cookies of the
Context node in Tomcat server.xml is the only place
I need to set. From the doc,

http://tomcat.apache.org/tomcat-5.5-doc/config/context.html

cookies:
Set to true if you want cookies to be used for session
identifier communication if supported by the client
(this is the default). Set to false if you want to
disable the use of cookies for session identifier
communication, and rely only on URL rewriting by the
application.

Thanks.

Michael

--- [EMAIL PROTECTED] 說:

 Michael,
 
 isNew() is mostly depends on how server manages the
 session.
 Returns true if the client does not yet know about
 the session or if the client
 chooses not to join the session. For example, if the
 server used only cookie based
 sessions, and the client had disabled the use of
 cookies, then a session
 would be new on each request.
 
 May be its worth checking your server session
 management.
 
 Chandra
--- Chan Michael [EMAIL PROTECTED] 說:

 Hi Chandra,
 
 Thanks for your prompt reply.
 
 I have checked many many times and I have 100% sure
 there is no 
 
 Request.getSession(true);
 
 in all my action classes.
 
 Thanks.
 
 Michael
 
 --- [EMAIL PROTECTED] :
 
  I think some where(may be in the action class
  association with the action /test.do) you are
  creating new session each time for each request.
  Most possible mistake could be using
  
  Request.getSession(true);
  
  See below documentation from Servlet
 Specifications
 

**
  getSession()
  public HttpSession getSession()
  Returns the current session associated with this
  request, or if the request does not have a
 session,
  creates one.
  Returns: the HttpSession associated with this
  request
  See Also: getSession(boolean)
  
  getSession(boolean)
  public HttpSession getSession(boolean create)
  Returns the current HttpSession associated with
  this request or, if if there is no current session
  and create is true, returns a new session. If
 create
  is false andthe request has no valid
 HttpSession,
  this method returns null.
  
  To make sure the session is properly maintained,
 you
  must call this method before the response is
  committed. If the container is using cookies to
  maintain session integrity and is asked to create
 a
  new session when the response is committed, an
  IllegalStateException is thrown.
  
  Parameters:
  codetrue/code - to create a new session for
 this
  request if necessary; false to return null if
  there*s no current session Returns: the
 HttpSession
  associated with this request or null if create is
  false and the request has no valid session
  See Also: getSession() 
 

**
  
  Chandra
  -Original Message-
  From: Chan Michael
  [mailto:[EMAIL PROTECTED] 
  Sent: Monday, April 24, 2006 2:48 PM
  To: user@struts.apache.org
  Subject: Session without cookies
  
  Hi All,
  
  I have been searching for hours and still cannot
  find any useful info. Hope you can help.
  
  I am building a Struts app. (Struts 1.2.4 + Tomcat
  5.5
  + Apache 2.0.55 + Spring 1.2.6) and want to use
  session without
  enabling cookies. I use html:link to create
 links
  so ;jsessionid is appended to the end. Fine. The
  problem I have is every time I access a page, a
 new
  session id is created so essentially everything
  stored in session is lost. Here is some output
 from
  my test action,
  test.do:
  
  test.do
  =
  HttpSession session = request.getSession();
  System.out.println(Is session new?  +
  session.isNew()); System.out.println(Session id:
 
  + session.getId());
  
  First access
  =
  Is session new? true
  Session id: B9F9E135DCBAC90AB2B5AEBCE901FAA5
  
  Second access
  =
  Is sesssion new? false
  Session id: 8CCE7A388E76C0F56016E8F41E29E0E5
  
  The session is not new but the id is different...I
  already set in Tomcat server.xml
  
  Context path=/myApp cookies=false...
  
  What am I missing??
  
  Thanks in advance.
  
  Michael
  
  ___
   YM - 褩#65533;#65533;洘
  
 

憩呾斕�]衄奻鋒ㄛ斕腔攬衭゛褫眕隱狟#65533;洘緻斕ㄛ#65533;斕奻鋒�r憩夔蕾撈艘善ㄛ¦睡挲#65533;飲�衿萯均�
   http://messenger.yahoo.com.hk
  
 

-
  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]
  
  
 
 
 ___
  YM - 離線訊息
 


Re: 回覆: RE: Session without cookies

2006-04-24 Thread Leon Rosenberg
On 4/24/06, Chan Michael [EMAIL PROTECTED] wrote:
 Hi Chandra,

 Thanks for your prompt reply.

 I have checked many many times and I have 100% sure
 there is no

 Request.getSession(true);

Request.getSession(true);
and
Request.getSession();

are 100% identical.

regards
Leon


 in all my action classes.

 Thanks.

 Michael


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



Re: StrutsTestCases

2006-04-24 Thread Li
A web application that is packed as a war file and deployed to Tomcat or
JBoss can work properly without having web.xml. Since you are using struts
and jsp. You need tell the server what is the servlet parser as well as
someother info. So make sure there is a VALID web.xml in your application
folder /WEB-INF.

On 4/24/06, Chaitanya Parkhi [EMAIL PROTECTED] wrote:

 hi guys i hav created a java file by using MockObjectStrutsTestCases which
 tests for a simple login form which takes Login Name  password as a
 input.in this file i hav following method

 public void testSuccessfulLogin() {

 setConfigFile(/WEB-INF/struts-config.xml);

 setRequestPathInfo(/login);
 addRequestParameter(username,cdp);
 addRequestParameter(password,[EMAIL PROTECTED]);

 actionPerform();

 String[] actionErrors = {username.required,password.required};
 verifyActionErrors(actionErrors);
 }

 if i run the above test junit window shows that ther  r no errors,but
 shows
 a warning that WB-INF\web.xml not found  does any1 knows why?




--
=
The world will be ended if love is everywhere.
    Shawzi


Validations from Nested Tags Data

2006-04-24 Thread Raghuveer
What are the possiable ways to Validate the data in
Actionform/DynaValidatorForm.

In below example.

txtCompany is the property in javabean(cBean).
In a collection(arlCollectionBeans) each row is a javabean(cBean).

Data is displayed by Nested Tags as below.

Example:
I want to validate for mandatory,integer


nested:present name=cActionForm scope=session
nested:notEmpty  name=cActionForm  property=arlCollectionBeans 
nested:size id=recordCount name=cActionForm
property=arlCollectionBeans/
nested:greaterThan name=recordCount  value=0
nested:iterate  id=cBean name=cActionForm
property=arlCollectionBeans type=com.example.nested.CBean indexId=i 
trtdnested:text  property=txtCompany 
//td/tr
/nested:iterate
/nested:greaterThan
/nested:notEmpty
/nested:present


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



Re: StrutsTestCases

2006-04-24 Thread Phil Zoio
You should be able to solve the problem by adding the WEB-INF directory 
onto your classpath. I couldn't get it to work otherwise


Chaitanya Parkhi wrote:


hi guys i hav created a java file by using MockObjectStrutsTestCases which
tests for a simple login form which takes Login Name  password as a
input.in this file i hav following method

public void testSuccessfulLogin() {

   setConfigFile(/WEB-INF/struts-config.xml);

   setRequestPathInfo(/login);
   addRequestParameter(username,cdp);
   addRequestParameter(password,[EMAIL PROTECTED]);

   actionPerform();

   String[] actionErrors = {username.required,password.required};
   verifyActionErrors(actionErrors);
}

if i run the above test junit window shows that ther  r no errors,but shows
a warning that WB-INF\web.xml not found  does any1 knows why?

 




No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.385 / Virus Database: 268.4.5/322 - Release Date: 22/04/2006
 



RE: Session without cookies

2006-04-24 Thread abdurrahman sahin
are you sure that u did not start a new browser process each time.?
because sessions are browser process based.
starting a new process and opening a new window within a browser window are
different things.

http://asahin.net


-Original Message-
From: Chan Michael [mailto:[EMAIL PROTECTED]
Sent: Monday, April 24, 2006 12:18 PM
To: user@struts.apache.org
Subject: Session without cookies


Hi All,

I have been searching for hours and still cannot find
any useful info. Hope you can help.

I am building a Struts app. (Struts 1.2.4 + Tomcat 5.5
+ Apache 2.0.55 + Spring 1.2.6) and want to use
session without
enabling cookies. I use html:link to create links so
;jsessionid is appended to the end. Fine. The problem
I have is every time I access a page, a new session id
is created so essentially everything stored in session
is lost. Here is some output from my test action,
test.do:

test.do
=
HttpSession session = request.getSession();
System.out.println(Is session new?  +
session.isNew());
System.out.println(Session id:  + session.getId());

First access
=
Is session new? true
Session id: B9F9E135DCBAC90AB2B5AEBCE901FAA5

Second access
=
Is sesssion new? false
Session id: 8CCE7A388E76C0F56016E8F41E29E0E5

The session is not new but the id is different...I
already set in Tomcat server.xml

Context path=/myApp cookies=false...

What am I missing??

Thanks in advance.

Michael

___
 YM - 離線訊息
 就算你沒有上網,你的朋友仍可以留下訊息給你,當你上網時就能立即看到,任何說
話都冇走失。
 http://messenger.yahoo.com.hk

-
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: Session without cookies

2006-04-24 Thread Chan Michael
Hi,

The test is done within the same tab in firefox.

Thanks.

Michael

--- abdurrahman sahin
[EMAIL PROTECTED] 說:

 are you sure that u did not start a new browser
 process each time.?
 because sessions are browser process based.
 starting a new process and opening a new window
 within a browser window are
 different things.
 
 http://asahin.net
 
 
 -Original Message-
 From: Chan Michael
 [mailto:[EMAIL PROTECTED]
 Sent: Monday, April 24, 2006 12:18 PM
 To: user@struts.apache.org
 Subject: Session without cookies
 
 
 Hi All,
 
 I have been searching for hours and still cannot
 find
 any useful info. Hope you can help.
 
 I am building a Struts app. (Struts 1.2.4 + Tomcat
 5.5
 + Apache 2.0.55 + Spring 1.2.6) and want to use
 session without
 enabling cookies. I use html:link to create links
 so
 ;jsessionid is appended to the end. Fine. The
 problem
 I have is every time I access a page, a new session
 id
 is created so essentially everything stored in
 session
 is lost. Here is some output from my test action,
 test.do:
 
 test.do
 =
 HttpSession session = request.getSession();
 System.out.println(Is session new?  +
 session.isNew());
 System.out.println(Session id:  +
 session.getId());
 
 First access
 =
 Is session new? true
 Session id: B9F9E135DCBAC90AB2B5AEBCE901FAA5
 
 Second access
 =
 Is sesssion new? false
 Session id: 8CCE7A388E76C0F56016E8F41E29E0E5
 
 The session is not new but the id is different...I
 already set in Tomcat server.xml
 
 Context path=/myApp cookies=false...
 
 What am I missing??
 
 Thanks in advance.
 
 Michael
 
 ___
  YM - 離線訊息
 

就算你沒有上網,你的朋友仍可以留下訊息給你,當你上網時就能立即看到,任何說
 話都冇走失。
  http://messenger.yahoo.com.hk
 

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


___
 YM - 離線訊息
 就算你沒有上網,你的朋友仍可以留下訊息給你,當你上網時就能立即看到,任何說話都冇走失。
 http://messenger.yahoo.com.hk

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



Extracting MessageResources from Struts

2006-04-24 Thread Julian Tillmann
Hi everyone, 

this question is not entirely a question about struts but just about a part
of it, which I would like to extract 
from the rest of the framework. It's like this: 
I have my own framework for creating dynamic SVGs and in one Class I
have tooltip-messages hardcoded in German. I don't want to destroy the
structure of the method-calls
and so I thought about Struts 
MessageResources where I can use different language packages in form
of property files. So far so good, 
but I don't want to add the whole struts to my framework but just the
MessageRessources-part and so my question is:
can I just extract the MessageResources.class or is there substitution
I can use for this? 

thanks very much in advance
Julian

-- 
Echte DSL-Flatrate dauerhaft für 0,- Euro*!
Feel free mit GMX DSL! http://www.gmx.net/de/go/dsl

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



Acegi with shale and clay

2006-04-24 Thread Ian.Priest
Hi,
 
I'm using Shale/Clay to create an application. I'd like to protect the
app with acegi's URL protection but I don't see a way to integrate with
the response rendering.
 
Here's an example: (all pages are rendered via Clay full html). I have
the structure
 
/welcome.html
/logon.html
/secure/page1.html
/secure/page2.html
 
the secure pages should only be accessable by those who have logged on
using logon.html. The secure/.. Pages are defined as a dialog called
secure.
 
In welcome.html i have an actionlink whose action is dialog:Secure
 
I configure acegi to protect urls as follows:

bean id=filterInvocationInterceptor
class=org.acegisecurity.intercept.web.FilterSecurityInterceptor
property name=authenticationManager
ref bean=authenticationManager /
/property
property name=accessDecisionManager
ref local=httpRequestAccessDecisionManager /
/property
property name=objectDefinitionSource
value
CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON 
PATTERN_TYPE_APACHE_ANT 
/secure/**=ROLE_USER
/**=ROLE_ANONYMOUS
/value
/property
property name=observeOncePerRequest value=false/
/bean

If I now hit my application at welcome.html I'm assigned role ANONYMOUS
and all is well. However, if I click on the link to the secure dialog
acegi doesn't redirect me to logon.html. The request generated when I
click on the actionlink appears to be a request for /welcome.html which
acegi says it's ok to access anonymously. Shale's dialog manager then
works out that the action is dialog:Secure and causes page1 of that
dialog to render, apparently without doing either a forward or a rediect
to /secure/page1.html. (In web.xml I have the mapping to acegi as
follows:
filter-mapping
filter-nameAcegi Filter Chain Proxy/filter-name
url-pattern/*/url-pattern
dispatcherFORWARD/dispatcher
dispatcherREQUEST/dispatcher
/filter-mapping
So forwards should also fire the filter).
That means acegi never has a chance to intercept the request. (Once I'm
in the dialog on page1.html, if I click on the next button I am
redirected to the logon.html page - acegi correctly intercepts the
/secure/page1.html request that is made).

How can I intercept Shale's page building and view rendering mechanisms
to ensure that my site's urls are secured correctly?

Cheers,
Ian.



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



Re: Extracting MessageResources from Struts

2006-04-24 Thread David Delbecq
Using message ressources is not struts specific. What struts does beside
using message ressources is maintaining the user language in user http
session and use it when it need a message ressouce use. If all you need
to do is have multi language support for your messages, i suggest you
take a look at how ressource bundles are used for i18n in the sun java
documentations http://java.sun.com/docs/books/tutorial/i18n/index.html

Please note basically the MessageResources is a front end to this
allowing configuration of ressources in struts xml configuration file.

Julian Tillmann a écrit :

Hi everyone, 

this question is not entirely a question about struts but just about a part
of it, which I would like to extract 
from the rest of the framework. It's like this: 
I have my own framework for creating dynamic SVGs and in one Class I
have tooltip-messages hardcoded in German. I don't want to destroy the
structure of the method-calls
and so I thought about Struts 
MessageResources where I can use different language packages in form
of property files. So far so good, 
but I don't want to add the whole struts to my framework but just the
MessageRessources-part and so my question is:
can I just extract the MessageResources.class or is there substitution
I can use for this? 

thanks very much in advance
Julian

  



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



RE: Acegi with shale and clay

2006-04-24 Thread hermod.opstvedt
Hi

Have you tried to define a navigation rule, and add redirect/ to that rule ?

Hermod

-Original Message-
From: Ian.Priest [mailto:[EMAIL PROTECTED]
Sent: Monday, April 24, 2006 1:28 PM
To: Struts Users Mailing List
Subject: Acegi with shale and clay


Hi,
 
I'm using Shale/Clay to create an application. I'd like to protect the
app with acegi's URL protection but I don't see a way to integrate with
the response rendering.
 
Here's an example: (all pages are rendered via Clay full html). I have
the structure
 
/welcome.html
/logon.html
/secure/page1.html
/secure/page2.html
 
the secure pages should only be accessable by those who have logged on
using logon.html. The secure/.. Pages are defined as a dialog called
secure.
 
In welcome.html i have an actionlink whose action is dialog:Secure
 
I configure acegi to protect urls as follows:

bean id=filterInvocationInterceptor
class=org.acegisecurity.intercept.web.FilterSecurityInterceptor
property name=authenticationManager
ref bean=authenticationManager /
/property
property name=accessDecisionManager
ref local=httpRequestAccessDecisionManager /
/property
property name=objectDefinitionSource
value
CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON 
PATTERN_TYPE_APACHE_ANT 
/secure/**=ROLE_USER
/**=ROLE_ANONYMOUS
/value
/property
property name=observeOncePerRequest value=false/
/bean

If I now hit my application at welcome.html I'm assigned role ANONYMOUS
and all is well. However, if I click on the link to the secure dialog
acegi doesn't redirect me to logon.html. The request generated when I
click on the actionlink appears to be a request for /welcome.html which
acegi says it's ok to access anonymously. Shale's dialog manager then
works out that the action is dialog:Secure and causes page1 of that
dialog to render, apparently without doing either a forward or a rediect
to /secure/page1.html. (In web.xml I have the mapping to acegi as
follows:
filter-mapping
filter-nameAcegi Filter Chain Proxy/filter-name
url-pattern/*/url-pattern
dispatcherFORWARD/dispatcher
dispatcherREQUEST/dispatcher
/filter-mapping
So forwards should also fire the filter).
That means acegi never has a chance to intercept the request. (Once I'm
in the dialog on page1.html, if I click on the next button I am
redirected to the logon.html page - acegi correctly intercepts the
/secure/page1.html request that is made).

How can I intercept Shale's page building and view rendering mechanisms
to ensure that my site's urls are secured correctly?

Cheers,
Ian.



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



* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

This email with attachments is solely for the use of the individual or
entity to whom it is addressed. Please also be aware that the DnB NOR Group
cannot accept any payment orders or other legally binding correspondence with
customers as a part of an email. 

This email message has been virus checked by the virus programs used
in the DnB NOR Group.

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


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



Re: Extracting MessageResources from Struts

2006-04-24 Thread Julian Tillmann
hi, 

thank you very much your answer has been very helpful :)

ciao 4 now 
Julian

 --- Ursprüngliche Nachricht ---
 Von: David Delbecq [EMAIL PROTECTED]
 An: Struts Users Mailing List user@struts.apache.org
 Betreff: Re: Extracting MessageResources from Struts
 Datum: Mon, 24 Apr 2006 13:37:45 +0200
 
 Using message ressources is not struts specific. What struts does beside
 using message ressources is maintaining the user language in user http
 session and use it when it need a message ressouce use. If all you need
 to do is have multi language support for your messages, i suggest you
 take a look at how ressource bundles are used for i18n in the sun java
 documentations http://java.sun.com/docs/books/tutorial/i18n/index.html
 
 Please note basically the MessageResources is a front end to this
 allowing configuration of ressources in struts xml configuration file.
 
 Julian Tillmann a écrit :
 
 Hi everyone, 
 
 this question is not entirely a question about struts but just about a
 part
 of it, which I would like to extract 
 from the rest of the framework. It's like this: 
 I have my own framework for creating dynamic SVGs and in one Class I
 have tooltip-messages hardcoded in German. I don't want to destroy the
 structure of the method-calls
 and so I thought about Struts 
 MessageResources where I can use different language packages in form
 of property files. So far so good, 
 but I don't want to add the whole struts to my framework but just the
 MessageRessources-part and so my question is:
 can I just extract the MessageResources.class or is there substitution
 I can use for this? 
 
 thanks very much in advance
 Julian
 
   
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 

-- 
Feel free - 10 GB Mailbox, 100 FreeSMS/Monat ...
Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail

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



RE: StrutsTestCases

2006-04-24 Thread Anuradha S.Athreya
U need to set the contect path of ur application:
setContextDirectory(new File(Your_Application_ContextPath)); 

-Original Message-
From: Phil Zoio [mailto:[EMAIL PROTECTED] 
Sent: Monday, April 24, 2006 3:39 PM
To: Struts Users Mailing List
Subject: Re: StrutsTestCases

You should be able to solve the problem by adding the WEB-INF directory onto
your classpath. I couldn't get it to work otherwise

Chaitanya Parkhi wrote:

hi guys i hav created a java file by using MockObjectStrutsTestCases 
which tests for a simple login form which takes Login Name  password 
as a input.in this file i hav following method

public void testSuccessfulLogin() {

setConfigFile(/WEB-INF/struts-config.xml);

setRequestPathInfo(/login);
addRequestParameter(username,cdp);
addRequestParameter(password,[EMAIL PROTECTED]);

actionPerform();

String[] actionErrors = {username.required,password.required};
verifyActionErrors(actionErrors); }

if i run the above test junit window shows that ther  r no errors,but 
shows a warning that WB-INF\web.xml not found  does any1 knows why?

  

---
-

No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.385 / Virus Database: 268.4.5/322 - Release Date: 
22/04/2006
  



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



Re: bean:define in including jsp

2006-04-24 Thread Vinit Sharma
Hi Dilip,

You can define the bean in tiles def to use it across the pages.

The put tag is used to associate a value to an attribute. It allows
specifying the attribute name and its value. The attribute value will be
retrieved by its name.
The value can be specified in several ways:
 as a bean defined in some scope:
tiles:put name=title beanName=aBean
beanScope=page|request|application|tiles/
The bean identified by beanName is retrieved, and its value used as
attribute value.
beanScope is optional, if not specified, bean is searched for in scopes in
the following
order: page, request and application. Scope tiles means the current Tile's
context (if
any). In this case, beanName identifies a Tile attribute name.
 as property of a bean defined in some scope:
tiles:put name=title beanName=aBean beanProperty=aProperty
beanScope=page|request|application|tiles/
This is a variant of the previous case. The value is not the retrieved bean,
but the returned value of the specified bean property.

OR

you can also explore topic 1.2.5 here:
http://struts.apache.org/struts-action/struts-tiles/userGuide.html

HTH,


On 4/21/06, Dilip Ladhani [EMAIL PROTECTED] wrote:

 Hey guys,

 We us Struts with tiles and here is something, I am having some trouble
 with.

 I have a main jsp (a.jsp). This jsp includes a few other jsps (using
 tiles:insert
 attribute=b/, where b=b.jsp).

 Now, if I have a bean:define in a .jsp (eg  bean:define name=aForm
 property=prop id=prop1 /), prop1 is usable in a.jsp, but not in
 b.jsp(the included or inserted jsp). Is this because, the tiles stuff
 is
 evaluated before the struts tags?

 If so, how can I have a bean:define in an including jsp, which can be used
 in all the included jsps? If I add this bean :define,  in b.jsp, it is
 obviously accessible in b.jsp, but I don't want to add bean:define in
 every
 included jsp .

 thanks,




--
Vinit Sharma
IBM


RE: Acegi with shale and clay

2006-04-24 Thread Ian.Priest
The main problem with that solution is that I'd rather not have to use
redirect everywhere as it will affect performance.  

Secondly, how would I configure the navigation rule?

My current view is /welcome.html so that's easy

navigation-rule
  from-view-id/welcome.html/from-view-id

My navigation case outcome is dialog:secure...

  navigation-case
from-outcomedialog:secure/from-outcome


But what is my to-view id? Is it the first page of the dialog?

   to-view-id/secure/page1.html/to-view-id

That can't be right as my dialog starts with an action rather than a
page view...

dialog name=secure start=Setup

action name=Setup method=#{secure$secure.setup}
transition outcome=success target=Page 1 /
/action

view name=Page 1 viewId=/secure/page1.html
transition outcome=next target=Page 2 /
/view

...

So my to-view-id would somehow have to refer to the action that starts
the dialog. Is that possible?

Athird issue here is that (I believe) DialogNavigationHandler intercepts
the outcome of dialog:secure and deals with it, so the navigation case
is never invoked anyway?

Cheers,
Ian.
 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: 24 April 2006 12:53
To: user@struts.apache.org
Subject: RE: Acegi with shale and clay

Hi

Have you tried to define a navigation rule, and add redirect/ to that
rule ?

Hermod

-Original Message-
From: Ian.Priest [mailto:[EMAIL PROTECTED]
Sent: Monday, April 24, 2006 1:28 PM
To: Struts Users Mailing List
Subject: Acegi with shale and clay


Hi,
 
I'm using Shale/Clay to create an application. I'd like to protect the
app with acegi's URL protection but I don't see a way to integrate with
the response rendering.
 
Here's an example: (all pages are rendered via Clay full html). I have
the structure
 
/welcome.html
/logon.html
/secure/page1.html
/secure/page2.html
 
the secure pages should only be accessable by those who have logged on
using logon.html. The secure/.. Pages are defined as a dialog called
secure.
 
In welcome.html i have an actionlink whose action is dialog:Secure
 
I configure acegi to protect urls as follows:

bean id=filterInvocationInterceptor
class=org.acegisecurity.intercept.web.FilterSecurityInterceptor
property name=authenticationManager
ref bean=authenticationManager /
/property
property name=accessDecisionManager
ref local=httpRequestAccessDecisionManager /
/property
property name=objectDefinitionSource
value
CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON 
PATTERN_TYPE_APACHE_ANT 
/secure/**=ROLE_USER
/**=ROLE_ANONYMOUS
/value
/property
property name=observeOncePerRequest value=false/ /bean

If I now hit my application at welcome.html I'm assigned role ANONYMOUS
and all is well. However, if I click on the link to the secure dialog
acegi doesn't redirect me to logon.html. The request generated when I
click on the actionlink appears to be a request for /welcome.html which
acegi says it's ok to access anonymously. Shale's dialog manager then
works out that the action is dialog:Secure and causes page1 of that
dialog to render, apparently without doing either a forward or a rediect
to /secure/page1.html. (In web.xml I have the mapping to acegi as
follows:
filter-mapping
filter-nameAcegi Filter Chain Proxy/filter-name
url-pattern/*/url-pattern
dispatcherFORWARD/dispatcher
dispatcherREQUEST/dispatcher
/filter-mapping
So forwards should also fire the filter).
That means acegi never has a chance to intercept the request. (Once I'm
in the dialog on page1.html, if I click on the next button I am
redirected to the logon.html page - acegi correctly intercepts the
/secure/page1.html request that is made).

How can I intercept Shale's page building and view rendering mechanisms
to ensure that my site's urls are secured correctly?

Cheers,
Ian.



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



* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *

This email with attachments is solely for the use of the individual or
entity to whom it is addressed. Please also be aware that the DnB NOR
Group cannot accept any payment orders or other legally binding
correspondence with customers as a part of an email. 

This email message has been virus checked by the virus programs used in
the DnB NOR Group.

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *


-
To unsubscribe, e-mail: [EMAIL PROTECTED]

LookupDispatchAction error

2006-04-24 Thread DOUILLARD David
Hello,

I have this error using Lookupdispatchaction

javax.servlet.ServletException: Action[/creationuser] missing resource
'valider' in key method map

My jsp have two buttons :

html:submit property=monaction bean:message key=button.valider /
/html:submit html:submit property=monaction bean:message
key=button.refuser / /html:submit


My ApplicationResources.properties

button.valider=valider 
button.refuser=refuser


My struts-config.xml 

action input=/saisieUser.jsp name=creationUserForm
parameter=monaction path=/creationuser scope=request
type=dsit.user.action.creationUserAction validate=true forward
name=affichageUser path=/affichageUser.jsp/ /action


And my lookupdispatchaction


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


//Traitement base de données pour refus 
java.lang.String monMessage = Refusé!; 
request.setAttribute(beanmonMessage,monMessage); 
return(mapping.findForward(affichageUser)); } 

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

//Traitement base de données pour refus 
java.lang.String monMessage = Validé!; 
request.setAttribute(beanmonMessage,monMessage); 
return(mapping.findForward(affichageUser)); } 

protected Map getKeyMethodMap() { 
Map map = new HashMap(); 
map.put(button.valider,valider); 
map.put(button.refuser,refuser); 
System.out.print(map.containsKey(button.valider)); // return true 
System.out.print(map.containsKey(button.refuser)); //return true 
System.out.print(map.containsValue(valider)); //return true 
System.out.print(map.containsValue(refuser)); //return true 
return map;


My button refuser works but not my button valider.
I don't understand why only one button works ?
Thanks

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



SV: Acegi with shale and clay

2006-04-24 Thread Hermod Opstvedt
Hi

A navigation case looks like this

navigation-case
from-outcomewhatever/from-outcome  * maps
all
to-view-idwhatever/to-view-id
redirect /
/navigation-case

As far as I know, the navigation case is always evaluated by the navigation
handler. Since you start with an action, I take you have an outcome.

Med vennlig hilsen
Hermod Opstvedt
Webmaster
Seiling.org/Norlys.org


-Opprinnelig melding-
Fra: Ian.Priest [mailto:[EMAIL PROTECTED] 
Sendt: 24. april 2006 15:37
Til: Struts Users Mailing List
Emne: RE: Acegi with shale and clay

The main problem with that solution is that I'd rather not have to use
redirect everywhere as it will affect performance.  

Secondly, how would I configure the navigation rule?

My current view is /welcome.html so that's easy

navigation-rule
  from-view-id/welcome.html/from-view-id

My navigation case outcome is dialog:secure...

  navigation-case
from-outcomedialog:secure/from-outcome


But what is my to-view id? Is it the first page of the dialog?

   to-view-id/secure/page1.html/to-view-id

That can't be right as my dialog starts with an action rather than a
page view...

dialog name=secure start=Setup

action name=Setup method=#{secure$secure.setup}
transition outcome=success target=Page 1 /
/action

view name=Page 1 viewId=/secure/page1.html
transition outcome=next target=Page 2 /
/view

...

So my to-view-id would somehow have to refer to the action that starts
the dialog. Is that possible?

Athird issue here is that (I believe) DialogNavigationHandler intercepts
the outcome of dialog:secure and deals with it, so the navigation case
is never invoked anyway?

Cheers,
Ian.
 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: 24 April 2006 12:53
To: user@struts.apache.org
Subject: RE: Acegi with shale and clay

Hi

Have you tried to define a navigation rule, and add redirect/ to that
rule ?

Hermod

-Original Message-
From: Ian.Priest [mailto:[EMAIL PROTECTED]
Sent: Monday, April 24, 2006 1:28 PM
To: Struts Users Mailing List
Subject: Acegi with shale and clay


Hi,
 
I'm using Shale/Clay to create an application. I'd like to protect the
app with acegi's URL protection but I don't see a way to integrate with
the response rendering.
 
Here's an example: (all pages are rendered via Clay full html). I have
the structure
 
/welcome.html
/logon.html
/secure/page1.html
/secure/page2.html
 
the secure pages should only be accessable by those who have logged on
using logon.html. The secure/.. Pages are defined as a dialog called
secure.
 
In welcome.html i have an actionlink whose action is dialog:Secure
 
I configure acegi to protect urls as follows:

bean id=filterInvocationInterceptor
class=org.acegisecurity.intercept.web.FilterSecurityInterceptor
property name=authenticationManager
ref bean=authenticationManager /
/property
property name=accessDecisionManager
ref local=httpRequestAccessDecisionManager /
/property
property name=objectDefinitionSource
value
CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON 
PATTERN_TYPE_APACHE_ANT 
/secure/**=ROLE_USER
/**=ROLE_ANONYMOUS
/value
/property
property name=observeOncePerRequest value=false/ /bean

If I now hit my application at welcome.html I'm assigned role ANONYMOUS
and all is well. However, if I click on the link to the secure dialog
acegi doesn't redirect me to logon.html. The request generated when I
click on the actionlink appears to be a request for /welcome.html which
acegi says it's ok to access anonymously. Shale's dialog manager then
works out that the action is dialog:Secure and causes page1 of that
dialog to render, apparently without doing either a forward or a rediect
to /secure/page1.html. (In web.xml I have the mapping to acegi as
follows:
filter-mapping
filter-nameAcegi Filter Chain Proxy/filter-name
url-pattern/*/url-pattern
dispatcherFORWARD/dispatcher
dispatcherREQUEST/dispatcher
/filter-mapping
So forwards should also fire the filter).
That means acegi never has a chance to intercept the request. (Once I'm
in the dialog on page1.html, if I click on the next button I am
redirected to the logon.html page - acegi correctly intercepts the
/secure/page1.html request that is made).

How can I intercept Shale's page building and view rendering mechanisms
to ensure that my site's urls are secured correctly?

Cheers,
Ian.



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

Re: How dose JFS deal with multi-threads

2006-04-24 Thread Craig McClanahan
On 4/23/06, 王曾wang_zeng [EMAIL PROTECTED] wrote:

 Thank you, Craig.
 If we preserve the tree on the server, then the tree sholud be saved
 in
 session scope. If  we don't  save the  tree on server, then  everytime a
 request arrives, the tree  should be  reconstructed  using  the value of
 the
 hidden field. Am I right?


That is correct.  Note, however, that you do not need to change anything
about how you actually *use* the components in your application.  The
setting is changed with a context initialization parameter only.

Craig


any help ?? Fwd: html:multibox validation using Struts Validator framework

2006-04-24 Thread HSS STANLEY
any help on this???

  Date: Fri, 21 Apr 2006 11:00:34 -0700 (PDT)
From: [EMAIL PROTECTED]
Subject: html:multibox validation using Struts Validator framework
To: user@struts.apache.org

Hi 
   
  I am trying to do a client side validation for html: multibox tag. I need to 
do client side validation if all the boxes are checked, before submitting the 
request. I tried using the depends=required rules in the validator-rules.xml.
   
  I see the JavaScript code in my jsp when I try to view source but I’m not 
getting the required alert ie All Check Box needs to be checked  ; when I’m 
not checking these Multibox and submitting the form.
   
  Please help
   
  Thanks
  HStanley
  


-
  Yahoo! Messenger with Voice. PC-to-Phone calls for ridiculously low rates.


-
New Yahoo! Messenger with Voice. Call regular phones from your PC and save big.

Re: LookupDispatchAction error

2006-04-24 Thread Gagan Jain
just check out in ur struts-config file,
if by mistake u have pressed space or tab after button.valider=valider
even I got the same error once
and this was the mistake

On 4/24/06, DOUILLARD David [EMAIL PROTECTED] wrote:

 Hello,

 I have this error using Lookupdispatchaction

 javax.servlet.ServletException: Action[/creationuser] missing resource
 'valider' in key method map

 My jsp have two buttons :

 html:submit property=monaction bean:message key=button.valider /
 /html:submit html:submit property=monaction bean:message
 key=button.refuser / /html:submit


 My ApplicationResources.properties

 button.valider=valider
 button.refuser=refuser


 My struts-config.xml

 action input=/saisieUser.jsp name=creationUserForm
 parameter=monaction path=/creationuser scope=request
 type=dsit.user.action.creationUserAction validate=true forward
 name=affichageUser path=/affichageUser.jsp/ /action


 And my lookupdispatchaction


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


 //Traitement base de données pour refus
 java.lang.String monMessage = Refusé!;
 request.setAttribute(beanmonMessage,monMessage);
 return(mapping.findForward(affichageUser)); }

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

 //Traitement base de données pour refus
 java.lang.String monMessage = Validé!;
 request.setAttribute(beanmonMessage,monMessage);
 return(mapping.findForward(affichageUser)); }

 protected Map getKeyMethodMap() {
 Map map = new HashMap();
 map.put(button.valider,valider);
 map.put(button.refuser,refuser);
 System.out.print(map.containsKey(button.valider)); // return
 true
 System.out.print(map.containsKey(button.refuser)); //return true
 System.out.print(map.containsValue(valider)); //return true
 System.out.print(map.containsValue(refuser)); //return true
 return map;


 My button refuser works but not my button valider.
 I don't understand why only one button works ?
 Thanks

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




--
Thanks and Regards
Gagan Jain


[shale] Form token giving NPE

2006-04-24 Thread Richard Wallace
I'm trying to use the token component on a form to ensure that a user 
doesn't submit the form more than once.  Whenever I try and submit the 
form a second time, I get a NPE.  I'm using it in Clay, if that makes 
any difference.  The code is simply:


form
   span jsfid=token id=token /
   span jsfid=message for=token class=validation-msg /
   ...
/form

I'm using the 1.0.3-SNAPSHOT jars from the maven-snapshot-repository, 
last updated on April 19th.  Any ideas why I'm getting the below NPE?


Thanks,
Rich

java.lang.NullPointerException: expr
   at 
javax.faces.component.UIComponentBase.findComponent(UIComponentBase.java:210)
   at 
org.apache.myfaces.renderkit.html.ext.HtmlMessageRenderer.createOutputLabelMap(HtmlMessageRenderer.java:200)
   at 
org.apache.myfaces.renderkit.html.ext.HtmlMessageRenderer.createOutputLabelMap(HtmlMessageRenderer.java:214)
   at 
org.apache.myfaces.renderkit.html.ext.HtmlMessageRenderer.createOutputLabelMap(HtmlMessageRenderer.java:214)
   at 
org.apache.myfaces.renderkit.html.ext.HtmlMessageRenderer.createOutputLabelMap(HtmlMessageRenderer.java:214)
   at 
org.apache.myfaces.renderkit.html.ext.HtmlMessageRenderer.createOutputLabelMap(HtmlMessageRenderer.java:214)
   at 
org.apache.myfaces.renderkit.html.ext.HtmlMessageRenderer.createOutputLabelMap(HtmlMessageRenderer.java:214)
   at 
org.apache.myfaces.renderkit.html.ext.HtmlMessageRenderer.createOutputLabelMap(HtmlMessageRenderer.java:214)
   at 
org.apache.myfaces.renderkit.html.ext.HtmlMessageRenderer.createOutputLabelMap(HtmlMessageRenderer.java:214)
   at 
org.apache.myfaces.renderkit.html.ext.HtmlMessageRenderer.getOutputLabelMap(HtmlMessageRenderer.java:184)
   at 
org.apache.myfaces.renderkit.html.ext.HtmlMessageRenderer.findInputLabel(HtmlMessageRenderer.java:128)
   at 
org.apache.myfaces.renderkit.html.ext.HtmlMessagesRenderer.getSummary(HtmlMessagesRenderer.java:54)
   at 
org.apache.myfaces.renderkit.html.HtmlMessageRendererBase.renderSingleFacesMessage(HtmlMessageRendererBase.java:101)
   at 
org.apache.myfaces.renderkit.html.HtmlMessagesRendererBase.renderList(HtmlMessagesRendererBase.java:94)
   at 
org.apache.myfaces.renderkit.html.HtmlMessagesRendererBase.renderMessages(HtmlMessagesRendererBase.java:75)
   at 
org.apache.myfaces.renderkit.html.ext.HtmlMessagesRenderer.encodeEnd(HtmlMessagesRenderer.java:42)
   at 
javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:331)
   at 
org.apache.shale.clay.component.Clay.recursiveRenderChildren(Clay.java:379)



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



Re: [shale] Form token giving NPE

2006-04-24 Thread Gary VanMatre
From: Richard Wallace [EMAIL PROTECTED] 

 I'm trying to use the token component on a form to ensure that a user 
 doesn't submit the form more than once. Whenever I try and submit the 
 form a second time, I get a NPE. I'm using it in Clay, if that makes 
 any difference. The code is simply: 
 
form
span jsfid=token id=token /
span jsfid=message for=token class=validation-msg /
...
/form

 
 I'm using the 1.0.3-SNAPSHOT jars from the maven-snapshot-repository, 
 last updated on April 19th. Any ideas why I'm getting the below NPE? 
 

It's working with myfaces 1.1.1.  The exception points at the findComponent but 
I would have guessed that we are not populating one of the message component 
attributes.   

Try adding the showSummary attribute to the message component.
  span jsfid=message for=token showSummary=true  /
Gary

 Thanks, 
 Rich 
 
 java.lang.NullPointerException: expr 
 at 
 javax.faces.component.UIComponentBase.findComponent(UIComponentBase.java:210) 
 at 
 org.apache.myfaces.renderkit.html.ext.HtmlMessageRenderer.createOutputLabelMap(H
  
 tmlMessageRenderer.java:200) 
 at 
 org.apache.myfaces.renderkit.html.ext.HtmlMessageRenderer.createOutputLabelMap(H
  
 tmlMessageRenderer.java:214) 
 at 
 org.apache.myfaces.renderkit.html.ext.HtmlMessageRenderer.createOutputLabelMap(H
  
 tmlMessageRenderer.java:214) 
 at 
 org.apache.myfaces.renderkit.html.ext.HtmlMessageRenderer.createOutputLabelMap(H
  
 tmlMessageRenderer.java:214) 
 at 
 org.apache.myfaces.renderkit.html.ext.HtmlMessageRenderer.createOutputLabelMap(H
  
 tmlMessageRenderer.java:214) 
 at 
 org.apache.myfaces.renderkit.html.ext.HtmlMessageRenderer.createOutputLabelMap(H
  
 tmlMessageRenderer.java:214) 
 at 
 org.apache.myfaces.renderkit.html.ext.HtmlMessageRenderer.createOutputLabelMap(H
  
 tmlMessageRenderer.java:214) 
 at 
 org.apache.myfaces.renderkit.html.ext.HtmlMessageRenderer.createOutputLabelMap(H
  
 tmlMessageRenderer.java:214) 
 at 
 org.apache.myfaces.renderkit.html.ext.HtmlMessageRenderer.getOutputLabelMap(Html
  
 MessageRenderer.java:184) 
 at 
 org.apache.myfaces.renderkit.html.ext.HtmlMessageRenderer.findInputLabel(HtmlMes
  
 sageRenderer.java:128) 
 at 
 org.apache.myfaces.renderkit.html.ext.HtmlMessagesRenderer.getSummary(HtmlMessag
  
 esRenderer.java:54) 
 at 
 org.apache.myfaces.renderkit.html.HtmlMessageRendererBase.renderSingleFacesMessa
  
 ge(HtmlMessageRendererBase.java:101) 
 at 
 org.apache.myfaces.renderkit.html.HtmlMessagesRendererBase.renderList(HtmlMessag
  
 esRendererBase.java:94) 
 at 
 org.apache.myfaces.renderkit.html.HtmlMessagesRendererBase.renderMessages(HtmlMe
  
 ssagesRendererBase.java:75) 
 at 
 org.apache.myfaces.renderkit.html.ext.HtmlMessagesRenderer.encodeEnd(HtmlMessage
  
 sRenderer.java:42) 
 at 
 javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:331) 
 at 
 org.apache.shale.clay.component.Clay.recursiveRenderChildren(Clay.java:379) 
 
 
 - 
 To unsubscribe, e-mail: [EMAIL PROTECTED] 
 For additional commands, e-mail: [EMAIL PROTECTED] 
 

RE: Acegi with shale and clay

2006-04-24 Thread Gary VanMatre
I think this one has come up in discussion before.  It's really more of a JSF 
issue.  There is an open ticket for a new shale feature that would allow 
plugging in security in a custom navigation handler.

http://issues.apache.org/struts/browse/STR-2788

Gary

-- Original message -- 
From: Ian.Priest [EMAIL PROTECTED] 

 The main problem with that solution is that I'd rather not have to use 
 redirect everywhere as it will affect performance. 
 
 Secondly, how would I configure the navigation rule? 
 
 My current view is /welcome.html so that's easy 
 
 
 /welcome.html 
 
 My navigation case outcome is dialog:secure... 
 
 
 dialog:secure 
 
 
 But what is my to-view id? Is it the first page of the dialog? 
 
 /secure/page1.html 
 
 That can't be right as my dialog starts with an action rather than a 
 page view... 
 
 
 
 
 
 
 
 
 
 
 
 ... 
 
 So my to-view-id would somehow have to refer to the action that starts 
 the dialog. Is that possible? 
 
 Athird issue here is that (I believe) DialogNavigationHandler intercepts 
 the outcome of dialog:secure and deals with it, so the navigation case 
 is never invoked anyway? 
 
 Cheers, 
 Ian. 
 
 
 -Original Message- 
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
 Sent: 24 April 2006 12:53 
 To: user@struts.apache.org 
 Subject: RE: Acegi with shale and clay 
 
 Hi 
 
 Have you tried to define a navigation rule, and add to that 
 rule ? 
 
 Hermod 
 
 -Original Message- 
 From: Ian.Priest [mailto:[EMAIL PROTECTED] 
 Sent: Monday, April 24, 2006 1:28 PM 
 To: Struts Users Mailing List 
 Subject: Acegi with shale and clay 
 
 
 Hi, 
 
 I'm using Shale/Clay to create an application. I'd like to protect the 
 app with acegi's URL protection but I don't see a way to integrate with 
 the response rendering. 
 
 Here's an example: (all pages are rendered via Clay full html). I have 
 the structure 
 
 /welcome.html 
 /logon.html 
 /secure/page1.html 
 /secure/page2.html 
 
 the secure pages should only be accessable by those who have logged on 
 using logon.html. The secure/.. Pages are defined as a dialog called 
 secure. 
 
 In welcome.html i have an actionlink whose action is dialog:Secure 
 
 I configure acegi to protect urls as follows: 
 
  class=org.acegisecurity.intercept.web.FilterSecurityInterceptor 
 
 
 
 
 
 
 
 
 CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON 
 PATTERN_TYPE_APACHE_ANT 
 /secure/**=ROLE_USER 
 /**=ROLE_ANONYMOUS 
 
 
 
 
 If I now hit my application at welcome.html I'm assigned role ANONYMOUS 
 and all is well. However, if I click on the link to the secure dialog 
 acegi doesn't redirect me to logon.html. The request generated when I 
 click on the actionlink appears to be a request for /welcome.html which 
 acegi says it's ok to access anonymously. Shale's dialog manager then 
 works out that the action is dialog:Secure and causes page1 of that 
 dialog to render, apparently without doing either a forward or a rediect 
 to /secure/page1.html. (In web.xml I have the mapping to acegi as 
 follows: 
 
 Acegi Filter Chain Proxy 
 /* 
 FORWARD 
 REQUEST 
 
 So forwards should also fire the filter). 
 That means acegi never has a chance to intercept the request. (Once I'm 
 in the dialog on page1.html, if I click on the next button I am 
 redirected to the logon.html page - acegi correctly intercepts the 
 /secure/page1.html request that is made). 
 
 How can I intercept Shale's page building and view rendering mechanisms 
 to ensure that my site's urls are secured correctly? 
 
 Cheers, 
 Ian. 
 
 
 
 - 
 To unsubscribe, e-mail: [EMAIL PROTECTED] 
 For additional commands, e-mail: [EMAIL PROTECTED] 
 
 
 
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
 * * 
 
 This email with attachments is solely for the use of the individual or 
 entity to whom it is addressed. Please also be aware that the DnB NOR 
 Group cannot accept any payment orders or other legally binding 
 correspondence with customers as a part of an email. 
 
 This email message has been virus checked by the virus programs used in 
 the DnB NOR Group. 
 
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
 * * 
 
 
 - 
 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] 
 

Some extra eyes to see where I'm screwing this code up...(form with Map property where keys-String, values-String[])

2006-04-24 Thread Rick Reumann
Thanks for any help...

Here's what the html page output looks like:

Product Roles
-

SomeProduct
[] INTERNALAUTHOR[]EXTERNALAUTHOR

SomeProduct2
[] INTERNALAUTHOR[]EXTERNALAUTHOR

SomeProduct3
[] INTERNALAUTHOR[]EXTERNALAUTHOR


Backing this output is an ActionForm with the property:

HashMap productRolesMap;
//there is also a Map with this same name put into
//request scope

The ActionForm map has the keys set to the productId (number as a String)
and the value is a String[]. When the form submits I just want to
have the form's productRolesMap set with the String[] of the
selected roles. (Since these aren't boolean properties, all I need
is the values of the selected items).

Below is the code I was trying to use and it's working fine for
displaying the intial set of information (correct items are checked
and unchecked). The problem is when it submits, the String[] arrays in
the Map are not being updated at all.

The setter for the productRolesMap is called, but apparently the new
values selected are not being reflected in this Map.

The code I'm working with:

c:forEach var=productMapItem items=${productRolesMap} varStatus=pStatus
b${productMapItem.key.productName}/b
div style=padding-left:15px;
c:forEach var=role items=${productMapItem.value}
html:multibox name=authenticateForm
 property=productRolesMap.${productMapItem.key.productId}
${role}
/html:multibox
${role}nbsp;nbsp;
/c:forEach
/div
br/br/
/c:forEach


A snippet of the resulting html looks like:

input type=checkbox name=productRolesMap.2 value=INTERNALAUTHOR
INTERNALAUTHOR


input type=checkbox name=productRolesMap.2 value=EXTERNALAUTHOR
checked=checked
EXTERNALAUTHOR

I'm sure it's something stupid that I'm doing wrong. (Isn't it always:)

--
Rick

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



Validation help required

2006-04-24 Thread Dinesh Mehra
Hi,

I am using struts 1.1

I have two textboxes (username, password).
My requirements is
- I need to display a standard error message when both the fields are empty
or when either of the field is empty.
- I need to display a different error message when both the the fields are
filled but username-pwd do not match.

In validation.xml I declared two field properties each for username and
password with the same msg key but the problem is that when the form is
submitted with both the fields empty then the same error msg appears twice.
How to rectify this situation.

Any kind of help would be highly appreciated.

Thanks.
Dinesh


Re: Validation help required

2006-04-24 Thread Srinivas Jadcharla
Use Validate method instead Validator framework



On 4/24/06, Dinesh Mehra [EMAIL PROTECTED] wrote:

 Hi,

 I am using struts 1.1

 I have two textboxes (username, password).
 My requirements is
 - I need to display a standard error message when both the fields are
 empty
 or when either of the field is empty.
 - I need to display a different error message when both the the fields are
 filled but username-pwd do not match.

 In validation.xml I declared two field properties each for username and
 password with the same msg key but the problem is that when the form is
 submitted with both the fields empty then the same error msg appears
 twice.
 How to rectify this situation.

 Any kind of help would be highly appreciated.

 Thanks.
 Dinesh




--
Thanks  Regards
Srinivas
732-648-9421(Cell)


RE: Validation help required

2006-04-24 Thread Chaudhary, Harsh
The fact that you are getting 2 messages makes sense as you are running
validation against both the fields. It does not matter if the arg key is
the same. That would just pick the same message from your properties
file twice.

You could try using the validWhen validator and accociating that
validation with only one of the fields. Also, instead of using an arg
element in validator.xml, use an msg element to specify whatever message
you want to specify.

Or you could write your own validator, which is a bit much in this case.
I have pretty much the same thing at work here and I just use validWhen.

Harsh.

-Original Message-
From: Dinesh Mehra [mailto:[EMAIL PROTECTED] 
Sent: Monday, April 24, 2006 1:47 PM
To: user@struts.apache.org
Subject: Validation help required


Hi,

I am using struts 1.1

I have two textboxes (username, password).
My requirements is
- I need to display a standard error message when both the fields are
empty
or when either of the field is empty.
- I need to display a different error message when both the the fields
are
filled but username-pwd do not match.

In validation.xml I declared two field properties each for username and
password with the same msg key but the problem is that when the form is
submitted with both the fields empty then the same error msg appears
twice.
How to rectify this situation.

Any kind of help would be highly appreciated.

Thanks.
Dinesh

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



Re: Some extra eyes to see where I'm screwing this code up...(form with Map property where keys-String, values-String[])

2006-04-24 Thread Rick Reumann
Ok, figured out the below.

I remember running into this before and I should have remembered it.
For those reading this from the archives at some late date...

it really helps if you use regular pojos as values for your Maps.
These pojos can thus have the proper getter/setters for access to the
type of object you really care about as storing as your map values.

When I nested the String[] inside of a Roles object (with String[]
getRoles method and setter) and then stuffed the Roles' object as the
value for each key in the map, things work fine.

so instead of

 property=productRolesMap.${productMapItem.key.productId}

I have

 property=productRolesMap.${productMapItem.key.productId}.roles

and everything is fine (and I did need to use the reset method to
reset the String[] object in the Roles object since I decided to use
Session scope because didn't feel like using Lazy objects).


On 4/24/06, Rick Reumann [EMAIL PROTECTED] wrote:
 Thanks for any help...

 Here's what the html page output looks like:

 Product Roles
 -

 SomeProduct
 [] INTERNALAUTHOR[]EXTERNALAUTHOR

 SomeProduct2
 [] INTERNALAUTHOR[]EXTERNALAUTHOR

 SomeProduct3
 [] INTERNALAUTHOR[]EXTERNALAUTHOR


 Backing this output is an ActionForm with the property:

 HashMap productRolesMap;
 //there is also a Map with this same name put into
 //request scope

 The ActionForm map has the keys set to the productId (number as a String)
 and the value is a String[]. When the form submits I just want to
 have the form's productRolesMap set with the String[] of the
 selected roles. (Since these aren't boolean properties, all I need
 is the values of the selected items).

 Below is the code I was trying to use and it's working fine for
 displaying the intial set of information (correct items are checked
 and unchecked). The problem is when it submits, the String[] arrays in
 the Map are not being updated at all.

 The setter for the productRolesMap is called, but apparently the new
 values selected are not being reflected in this Map.

 The code I'm working with:

 c:forEach var=productMapItem items=${productRolesMap} 
 varStatus=pStatus
 b${productMapItem.key.productName}/b
 div style=padding-left:15px;
 c:forEach var=role items=${productMapItem.value}
 html:multibox name=authenticateForm
  property=productRolesMap.${productMapItem.key.productId}
 ${role}
 /html:multibox
 ${role}nbsp;nbsp;
 /c:forEach
 /div
 br/br/
 /c:forEach


 A snippet of the resulting html looks like:

 input type=checkbox name=productRolesMap.2 value=INTERNALAUTHOR
 INTERNALAUTHOR


 input type=checkbox name=productRolesMap.2 value=EXTERNALAUTHOR
 checked=checked
 EXTERNALAUTHOR

 I'm sure it's something stupid that I'm doing wrong. (Isn't it always:)

 --
 Rick



--
Rick

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



Pluggable Validator question

2006-04-24 Thread kkumar

Hello All,

I am trying to use the TwoField pluggable Validator example from the
struts's site. I replaced the deprecated method calls in
validateTwoFields(..). For some reason, when I run my application, it
doesn't validate the input fields. Instead it directly takes me to the
success page after I hit submit. I tried debugging the
validateTwoFields(..) and found that it's returning false when the input
fields did not match. But still the control is forwarding to the success
page. Here's my action mapping.

action path=/pwdAction
  name=pwdForm
  type=actions.PWDAction
  scope=request
  validate=true
  input=/password.jsp
  forward=/success.jsp
  forward name=success path=/success.jsp/


What am I doing wrong?

Thanks,
Kiran


-
The information contained in this message is intended only for the
personal and confidential use of the recipient(s) named above. If
the reader of this message is not the intended recipient or an
agent responsible for delivering it to the intended recipient, you
are hereby notified that you have received this document in error
and that any review, dissemination, distribution, or copying of
this message is strictly prohibited. If you have received this
communication in error, please notify us immediately, and delete
the original message.


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



Re: Pluggable Validator question

2006-04-24 Thread Dave Newton
[EMAIL PROTECTED] wrote:
 What am I doing wrong?
   

Don't know.

Unfortunately showing us an action mapping isn't enough to help, since
there's configuration, code, etc. involved.

Dave



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



Re: Pluggable Validator question

2006-04-24 Thread kkumar

Dave,

Here's my method that does the validation:

public static boolean validateTwoFields(Object bean, ValidatorAction va,
  Field
field, ActionErrors errors,

HttpServletRequest request) {

String value = ValidatorUtils.getValueAsString(bean,
field.getProperty());
String sProperty2 = field.getVarValue(secondProperty);
String value2 = ValidatorUtils.getValueAsString(bean,
sProperty2);

if (!GenericValidator.isBlankOrNull(value)) {
   try {
if (!value.equals(value2)) {

 errors.add(field.getKey(), new ActionMessage(
errors.twofields, value, value2));

 return false;
}
   } catch (Exception e) {
errors.add(field.getKey(), new ActionMessage(
errors.twofields, value, value2));
return false;
   }
}

return true;
  }

Here's the snippet from validations.xml.
formset
  form name=pwdForm
  field property=pwd1
  depends=required,twofields
  arg0 key=pwdForm.password/
  arg1 key=pwdForm.confirmPassword/
  var
  var-namesecondProperty/var-name
  var-valuepwd2/var-value
  /var
/field
  /form
/formset

Here's the snippet from validation-rules.xml

validator  name=twofields
  classname=validators.StrutsValidator
method=validateTwoFields
methodParams=java.lang.Object,

org.apache.commons.validator.ValidatorAction,
   org.apache.commons.validator.Field,
   org.apache.struts.action.ActionErrors,
   javax.servlet.http.HttpServletRequest
msg=errors.twofields/



Here's password.jsp.

%@ taglib uri=/WEB-INF/struts-html.tld prefix=html %
%@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean %

html:html
  head

  /head
  html:form action=pwdAction.do
pwd # html:text property=pwd1/
br
pwd # html:text property=pwd2/
p
html:submitSubmit/html:submit
  /html:form
  font color=red
html:errors/
  /font
/html:html



My PWDAction.java doesn't have much. But, here it is.

public class PWDAction extends Action {
  public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {

return mapping.findForward(success);
  }
}

Advanced thanks for your time,
Kiran

















   
 Dave Newton   
 [EMAIL PROTECTED] 
 com   To 
   Struts Users Mailing List   
 04/24/2006 04:43  user@struts.apache.org
 PM cc 
   
   Subject 
 Please respond to Re: Pluggable Validator question
   Struts Users   
   Mailing List   
 [EMAIL PROTECTED] 
  he.org  
   
   




[EMAIL PROTECTED] wrote:
 What am I doing wrong?


Don't know.

Unfortunately showing us an action mapping isn't enough to help, since
there's configuration, code, etc. involved.

Dave



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




-
The information contained in this message is intended only for the
personal and confidential use of the recipient(s) named above. If
the reader of this message is not the intended recipient or an
agent responsible for delivering it to the intended recipient, you
are hereby notified that you have received this document in error
and that any review, dissemination, distribution, or copying of
this message is strictly prohibited. If you have received this
communication 

RE: 回覆: RE: Session without cookies

2006-04-24 Thread Wang, Hansen
Michael,

It would help isolate the problem if you can use firefox's LiveHttpHeaders 
http://livehttpheaders.mozdev.org/ to examine Set-Cookies header from tomcat 
and Cookie header to tomcat.

HTH

Hansen 

-Original Message-
From: Chan Michael [mailto:[EMAIL PROTECTED] 
Sent: Monday, April 24, 2006 3:22 AM
To: Struts Users Mailing List
Subject: 回覆: RE: Session without cookies

Hi,

The test is done within the same tab in firefox.

Thanks.

Michael

--- abdurrahman sahin
[EMAIL PROTECTED] �f:

 are you sure that u did not start a new browser process each time.?
 because sessions are browser process based.
 starting a new process and opening a new window within a browser 
 window are different things.
 
 http://asahin.net
 
 
 -Original Message-
 From: Chan Michael
 [mailto:[EMAIL PROTECTED]
 Sent: Monday, April 24, 2006 12:18 PM
 To: user@struts.apache.org
 Subject: Session without cookies
 
 
 Hi All,
 
 I have been searching for hours and still cannot find any useful info. 
 Hope you can help.
 
 I am building a Struts app. (Struts 1.2.4 + Tomcat
 5.5
 + Apache 2.0.55 + Spring 1.2.6) and want to use
 session without
 enabling cookies. I use html:link to create links so ;jsessionid is 
 appended to the end. Fine. The problem I have is every time I access a 
 page, a new session id is created so essentially everything stored in 
 session is lost. Here is some output from my test action,
 test.do:
 
 test.do
 =
 HttpSession session = request.getSession(); System.out.println(Is 
 session new?  + session.isNew()); System.out.println(Session id:  + 
 session.getId());
 
 First access
 =
 Is session new? true
 Session id: B9F9E135DCBAC90AB2B5AEBCE901FAA5
 
 Second access
 =
 Is sesssion new? false
 Session id: 8CCE7A388E76C0F56016E8F41E29E0E5
 
 The session is not new but the id is different...I already set in 
 Tomcat server.xml
 
 Context path=/myApp cookies=false...
 
 What am I missing??
 
 Thanks in advance.
 
 Michael
 
 ___
  YM - �x息
 

就算你�]有上�W,你的朋友仍可以留下��息�o你,��你上�W�r就能立即看到,任何�f
 ��都�幼呤А�
  http://messenger.yahoo.com.hk
 

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


___
 YM - �x息
 就算你�]有上�W,你的朋友仍可以留下��息�o你,��你上�W�r就能立即看到,任何�f��都�幼呤А�
 http://messenger.yahoo.com.hk

-
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: .NET/WebServices/Java

2006-04-24 Thread John B. Walker
Thanks Ted!  I will dust off my old sourceforge.net account and take this
conversation off the user group with you personally.  I appreciate the
help.  It's people like you that make it easy for developers to come into
the Open Dev community.

Thanks again,
John

On 4/23/06, Ted Husted [EMAIL PROTECTED] wrote:

 On 4/23/06, John B. Walker [EMAIL PROTECTED] wrote:
  My next question for you Ted (or others), is:
  How would I contribute this source back to Struts, and do you think
 that
  the committee would be interested in adopting this framework into the
 Struts
  project?

 The first step would be to get the code out there where people can
 try it. This can simply  be a matter of setting up a home page that
 describes the product with a link to download the package. A very good
 way to get started is to setup a Java.net or Sourceforge.net project.
 If you don't want to start your own project, there is a Struts
 SourceForge project (struts.sf.net) where you could upload the code.
 Just take out a SourceForge account and let me know what your user id,
 and a working name for the product, and I'll setup a module for you,

 In general, the ASF isn't interested in donations of code that do not
 include a community of developers who are ready, willing, and able to
 maintain the code. The ASF has no paid staff, so we have to be sure
 that there are volunteers to do the work. The first step is finding
 volunteers to help with an open source project is to publish the
 source :)

 HTH, Ted.

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




[Shale] AbstractViewController for Dummies

2006-04-24 Thread James Reynolds

My understanding of the JSF lifecycle is a bit tenuous.  As a result,
I'm confused about the proper use of init(), preprocess(), and
prerender().  Thus far, I've just been using init() and destroy() to
handle the creation and closing of Connections and other minor duties
because they have just worked for what I needed.  Now, I'm moving on
with some more complex pages and I want to be sure that I'm leveraging
the AbstractViewController for all it's worth.

The documentation does a good job of explaining when and under what
conditions the events are fired, however, my weakness is that I just
don't know what kind of jsf programming events to stuff in each one.

If I have a component that uses select items (that don't live in the
application or session scopes), should I build them in init() or
prerender()?  These are the kinds of questions I wrestle with.

An actual issue that I'm working through now is this: I have a page that
lists 'Contracts'.  If the user clicks one, the plan is to navigate to a
detail page, with the Contract's id number stored in the parameter map.
The detail page's backing bean needs to instantiate a Contract object
based on the id value, but do I do that in the bean constructor, the
init() or the prerender() methods?

Any advice would be appreciated.

Thanks


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



Re: [Shale] AbstractViewController for Dummies

2006-04-24 Thread Craig McClanahan
On 4/24/06, James Reynolds [EMAIL PROTECTED] wrote:


 My understanding of the JSF lifecycle is a bit tenuous.  As a result,
 I'm confused about the proper use of init(), preprocess(), and
 prerender().  Thus far, I've just been using init() and destroy() to
 handle the creation and closing of Connections and other minor duties
 because they have just worked for what I needed.  Now, I'm moving on
 with some more complex pages and I want to be sure that I'm leveraging
 the AbstractViewController for all it's worth.

 The documentation does a good job of explaining when and under what
 conditions the events are fired, however, my weakness is that I just
 don't know what kind of jsf programming events to stuff in each one.

 If I have a component that uses select items (that don't live in the
 application or session scopes), should I build them in init() or
 prerender()?  These are the kinds of questions I wrestle with.


That's a really useful question to help you understand the differences.  The
short answer is either of these will technically work.  Some help, huh
:-).  But there is an important difference in behavior that can help you
choose.

* The init() method is *always* called if this view controller is ever
  instantiated.

* The prerender() method is *only* called if the corresponding view
  is actually going to be rendered.  If you have navigated to some
  different page, the prerender() method on *that* page's view controller
  will be called instead of this one.  That can save you from having
  to do a bunch of expensive database queries that you do not need.

So, one way to look at what event method should be used for what kind of
application logic is to consider the following two questions:

(1) Do I need the results of this computation in order to process a form
submit?

(2) Do I need the results of this computation in order to render the page?

Based on the anaswers, I would suggest sorting things out like this:

* Use init() for (1) and (2)

* Use preprocess() for (1) only

* Use prerender for (2) only

And, you can always put any necessary cleanup code in destroy().

So, what's the answer for the use case you just described?  It turns out
that init() is actually the correct answer -- because when you the form for
this view, the UISelectOne or UISelectMany component performs validation on
the input value(s) against the set of select items that are defined.  If you
are not storing the items in session or application scope, then you will
need to reload them in order for these validations to not fail.

On the other hand, if you *did* have the select items in session or
application scope, then you could move the logic to prerender() and only
spend the effort to accumulate the items list the first time it is rendered.

An actual issue that I'm working through now is this: I have a page that
 lists 'Contracts'.  If the user clicks one, the plan is to navigate to a
 detail page, with the Contract's id number stored in the parameter map.
 The detail page's backing bean needs to instantiate a Contract object
 based on the id value, but do I do that in the bean constructor, the
 init() or the prerender() methods?


Does the detail page itself have a form that can be submitted back in
again?  If so, then init() would be the right place -- by the same logic as
above (you need it for both form processing and rendering).  If the page
just has navigation links, prerender() would work.

Any advice would be appreciated.

 Thanks


Craig


RE: [Shale] AbstractViewController for Dummies

2006-04-24 Thread James Reynolds

I printed your answer and hung it on my cubical wall, where it will
continue to help me in the future.

24k gold, Thank you!

 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Craig
McClanahan
Sent: Monday, April 24, 2006 4:03 PM
To: Struts Users Mailing List
Subject: Re: [Shale] AbstractViewController for Dummies

On 4/24/06, James Reynolds [EMAIL PROTECTED] wrote:


 My understanding of the JSF lifecycle is a bit tenuous.  As a result, 
 I'm confused about the proper use of init(), preprocess(), and 
 prerender().  Thus far, I've just been using init() and destroy() to 
 handle the creation and closing of Connections and other minor duties 
 because they have just worked for what I needed.  Now, I'm moving on 
 with some more complex pages and I want to be sure that I'm leveraging

 the AbstractViewController for all it's worth.

 The documentation does a good job of explaining when and under what 
 conditions the events are fired, however, my weakness is that I just 
 don't know what kind of jsf programming events to stuff in each one.

 If I have a component that uses select items (that don't live in the 
 application or session scopes), should I build them in init() or 
 prerender()?  These are the kinds of questions I wrestle with.


That's a really useful question to help you understand the differences.
The short answer is either of these will technically work.  Some help,
huh :-).  But there is an important difference in behavior that can help
you choose.

* The init() method is *always* called if this view controller is ever
  instantiated.

* The prerender() method is *only* called if the corresponding view
  is actually going to be rendered.  If you have navigated to some
  different page, the prerender() method on *that* page's view
controller
  will be called instead of this one.  That can save you from having
  to do a bunch of expensive database queries that you do not need.

So, one way to look at what event method should be used for what kind of
application logic is to consider the following two questions:

(1) Do I need the results of this computation in order to process a form
submit?

(2) Do I need the results of this computation in order to render the
page?

Based on the anaswers, I would suggest sorting things out like this:

* Use init() for (1) and (2)

* Use preprocess() for (1) only

* Use prerender for (2) only

And, you can always put any necessary cleanup code in destroy().

So, what's the answer for the use case you just described?  It turns out
that init() is actually the correct answer -- because when you the form
for this view, the UISelectOne or UISelectMany component performs
validation on the input value(s) against the set of select items that
are defined.  If you are not storing the items in session or application
scope, then you will need to reload them in order for these validations
to not fail.

On the other hand, if you *did* have the select items in session or
application scope, then you could move the logic to prerender() and only
spend the effort to accumulate the items list the first time it is
rendered.

An actual issue that I'm working through now is this: I have a page that
 lists 'Contracts'.  If the user clicks one, the plan is to navigate to

 a detail page, with the Contract's id number stored in the parameter
map.
 The detail page's backing bean needs to instantiate a Contract object 
 based on the id value, but do I do that in the bean constructor, the
 init() or the prerender() methods?


Does the detail page itself have a form that can be submitted back in
again?  If so, then init() would be the right place -- by the same logic
as above (you need it for both form processing and rendering).  If the
page just has navigation links, prerender() would work.

Any advice would be appreciated.

 Thanks


Craig


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



[OT] Verifying Image Generator?

2006-04-24 Thread draegoon Z



Does anyone know where I can find one of those image code generators
that verifies that a person is submitting a form and not a computer?

I'd rather not stop to recreate the wheel.

Thanks



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



RequestUtils.message in struts 1.1

2006-04-24 Thread Garner Shawn
I'm trying to get my Spanish text using the RequestUtils.message method.
I get my English just fine when using the following but when the
locale is set to Spanish in the action class then this doesn't work:

RequestUtils.message(pageContext, Globals.MESSAGES_KEY,
Globals.LOCALE_KEY, (String) keyTable.get(name));

Is it looking in the request scope only because I think those keys are
only in the session?  I know my Spanish is there because my page
displays in Spanish except for the portion that I use
RequestUtils.message for.

Is ther an equivilent to get it from the session?

Any help?

Shawn

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



Re: [Shale] AbstractViewController for Dummies

2006-04-24 Thread Wendy Smoak
On 4/24/06, James Reynolds [EMAIL PROTECTED] wrote:

 I printed your answer and hung it on my cubical wall, where it will
 continue to help me in the future.

We have a more visible place for these gems. :)

 * http://wiki.apache.org/struts/ShaleCoreLibrary

--
Wendy

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



RE: [OT] Verifying Image Generator?

2006-04-24 Thread Steve Widmar
 Does anyone know where I can find one of those image code generators
 that verifies that a person is submitting a form and not a computer?
Not me.

 I'd rather not stop to recreate the wheel.
Sensible enough, but if you find you have to, here's one pseudoapproach
I've never tried that could work:

. programmatically generate the xml text for an SVG image
  (the images themselves don't look all that complex, and the key text
overlaid is just text at this point)

. convert the svg to some binary web image format like png (e.g., via
cocoon)

Cheers, 
Steve

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



Re: [Shale] AbstractViewController for Dummies

2006-04-24 Thread Craig McClanahan
On 4/24/06, Wendy Smoak [EMAIL PROTECTED] wrote:

 On 4/24/06, James Reynolds [EMAIL PROTECTED] wrote:

  I printed your answer and hung it on my cubical wall, where it will
  continue to help me in the future.

 We have a more visible place for these gems. :)

 * http://wiki.apache.org/struts/ShaleCoreLibrary


Thanks ... you're quick!

I really was thinking about doing just that, but had a con call right after
I finished typing the response to James's question :-).

--
 Wendy


Craig


Re: [OT] Verifying Image Generator?

2006-04-24 Thread Wendy Smoak
On 4/24/06, draegoon Z [EMAIL PROTECTED] wrote:

 Does anyone know where I can find one of those image code generators
 that verifies that a person is submitting a form and not a computer?

I haven't used it, but JCaptcha lists Struts integration as a feature:

 * http://jcaptcha.sourceforge.net/main.html
 * http://forge.octo.com/jcaptcha/confluence/display/general/Struts+integration

--
Wendy

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



Re: [OT] Verifying Image Generator?

2006-04-24 Thread Joseph McGranaghan

Thanks Wendy.

In a glance, it looks like something I can put to good use.

I will attempt to integrate it into my webapp.



Wendy Smoak wrote:

On 4/24/06, draegoon Z [EMAIL PROTECTED] wrote:

  

Does anyone know where I can find one of those image code generators
that verifies that a person is submitting a form and not a computer?



I haven't used it, but JCaptcha lists Struts integration as a feature:

 * http://jcaptcha.sourceforge.net/main.html
 * http://forge.octo.com/jcaptcha/confluence/display/general/Struts+integration

--
Wendy

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



  


Re: Struts 1.2.9 does not throw InvalidCancelException

2006-04-24 Thread Niall Pemberton
On 4/24/06, Lixin Chu [EMAIL PROTECTED] wrote:
 just upgraded from 1.2.8 to 1.2.9. I did not add

  set-property property=cancellable value=true/

 in struts-config.xml and still use html:cancel as per normal in jsp files.
 Tested, do not see exception and no validation is called.

It only gets thrown if the action is set to validate=true in the
strutc-config.xml. If no validation is being called then this would
suggest that you don't have this set.

Niall

 any reason why ? default setting ?

 btw, my action is LookupDispatchAction.

 rgds
 lixin

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



Re: How dose JFS deal with multi-threads

2006-04-24 Thread 王曾wang_zeng
Thanks a lot. Your answer  really eliminates some of my confusions about
JSF.

--
Wang Zeng


Re: Pluggable Validator question

2006-04-24 Thread Niall Pemberton
On 4/24/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 Hello All,

 I am trying to use the TwoField pluggable Validator example from the
 struts's site. I replaced the deprecated method calls in
 validateTwoFields(..). For some reason, when I run my application, it
 doesn't validate the input fields. Instead it directly takes me to the
 success page after I hit submit. I tried debugging the
 validateTwoFields(..) and found that it's returning false when the input
 fields did not match. But still the control is forwarding to the success
 page. Here's my action mapping.

Returning false from a validator doesn't stop struts from continuing
- its adding a message(s) to the ActionErrors returned by the
ActionForm's validate method. If you look at the Struts FieldChecks
class you will see that all the configured methods do that. So is your
validateTwoFields(...) method doing it?

Niall

action path=/pwdAction
  name=pwdForm
  type=actions.PWDAction
  scope=request
  validate=true
  input=/password.jsp
  forward=/success.jsp
  forward name=success path=/success.jsp/


 What am I doing wrong?

 Thanks,
 Kiran

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



Tiles vs. jsp:include + XHTML/CSS

2006-04-24 Thread Michael Jouravlev
Does using Tiles still makes sense in 2006? Please correct me if I am
wrong, but if I understand correctly, main Tiles featurs are:

* Uniform LF (block layout, colors, etc)
* Tile definitions

Uniform LF
---

The layout is defined in a layout file. Follows is the layout style
pulled right from Tiles page [1]:

%@ taglib uri=http://struts.apache.org/tags-tiles; prefix=tiles %
table  border=2  width=300  bordercolor=Gray
  tr
td  bgcolor=Blue
  strongtiles:getAsString name=title//strong
/td
  /tr
  tr
tdtiles:insert attribute=header//td
  /tr
  tr
tdtiles:insert attribute=body//td
  /tr
/table

This antiquated sample does not promote good HTML design. It uses
table instead of div or span elements, and it uses HTML attributes
like bgcolor.

The concrete page would use code like this [1]:

%@ taglib uri=http://struts.apache.org/tags-tiles; prefix=tiles %
tiles:insert template=layout.jsp
  tiles:put name=title  value=This is the title. /
  tiles:put name=header value=header.jsp /
  tiles:put name=body   value=body.jsp /
/tiles:insert

I still have to specify all these tiles:put tags that refer to
particular header/footer files (Definition solves that, see below).

What if instead of using

  tiles:put name=header value=header.jsp /

one would use something like this:

  div class=headerjsp:include page=header.jsp //div

and would have an appropriate set of rules for header class in a CSS
file? Would not it be the same without using Tiles layout file?

Tile definitions


Specifying tiles:put tags that refer to particular header/footer
files does not make a lot of sense, so Tiles allows to have
definitions in a JSP file or in XML. If I have definition in a JSP
file, I would include it with include directive.

Again, what if a JSP file with definitions contained just a list of
regular JSP includes for the header, menu and footer, and every
include would be wrapped into a div or span with specific CSS
id/class? Would not it be quite similar?

So, the question I am asking: what are the real benefits of using
Tiles if I use JSP includes + XHTML/CSS for layout/styling? Can most
of Tiles features be implemented with XHTML/CSS?

Michael.

[1] http://struts.apache.org/struts-action/struts-tiles/examples.html

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



Re: [OT] Verifying Image Generator?

2006-04-24 Thread Frank W. Zammetti

Another possible option can be found in Java Web Parts:

http://javawebparts.sourceforge.net/javadocs/javawebparts/servlet/TextRendererServlet.html

Select a suitably wacky font and you should be all set.  Note the 
comments in the javadoc, this does *not* have to be used as a servlet, 
you can call its functionality manually, i.e., from an Action, etc.


The full sample app for JWP shows its usage:

http://javawebparts.sourceforge.net

Frank

draegoon Z wrote:



Does anyone know where I can find one of those image code generators
that verifies that a person is submitting a form and not a computer?

I'd rather not stop to recreate the wheel.

Thanks



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






--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]
Java Web Parts -
http://javawebparts.sourceforge.net
Supplying the wheel, so you don't have to reinvent it!

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



Re: friday ha ha

2006-04-24 Thread Niall Pemberton
On 4/22/06, Jonathan Revusky [EMAIL PROTECTED] wrote:

snip
 Here is what I think someone would find by examining the archive.
 Whenever certain pointed questions are posed, one of two things happens:

 (1) The person being posed the question simply walks away from the
 discussion. This has happened at least a couple of times in
 conversations where I have asked you to clarify points you have made,
 Ted. This is also the approach Niall Pemberton has used a couple of
 times. You write something, and then when somebody brings up
 counter-arguments are asks you to clarify one or more of your points,
 you  just walk away from the discussion.
/snip

Well this goes both ways - you never answered me when I asked you for
clarification...

http://www.mail-archive.com/user@struts.apache.org/msg43608.html
http://www.mail-archive.com/user@struts.apache.org/msg43583.html

Niall

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



Proposal for change

2006-04-24 Thread Frank W. Zammetti

Dear Struts community,


We have seen a rash of what most people consider noise on these lists 
recently, and I can't deny that I was even part of some of it (although 
I hope somewhat more constructively than some).  However, underlying the 
noise I feel were a few valid points worth considering.  I for one have.


What I've come away with is a proposal I would like to make.  It would 
represent a procedural change of sorts, or addition to be more accurate. 
 I ask that anyone who has a thought on it please feel free to comment, 
but I ask that you try and do so constructively.  It is not my intention 
to start another 200-post thread that quickly devolves into name-calling 
and insults.


Also, please try not to get hung up on all the details, because they are 
debatable and negotiable (although I have tried to make them reasonable 
to start with).  The two principles described in the conclusion are what 
is really important.  The details of how this would work can be adjusted 
to make everyone happy.



A proposal for community-based committer nominations


* Rationale
One of the issues that a number of people seem to have with the way 
Struts has progressed is the seeming inability (or difficulty at least) 
of getting new blood involved.  There seems to be a perception by many 
that there is a bit of a closed club mentality with regard to being 
invited in as a committer and that the Struts community at large has no 
say in the matter.


* Proposed Change:
First, let me make clear that this proposal does NOT change the existing 
mechanism by which someone is invited to be a committer.  That decision 
still rests soley with the PMC.  This proposal only seeks to build on 
top of that mechanism.  I propose that a community-based nomination 
process be instituted.  For the sake of discussion, a qualified person 
is anyone that has been on the Struts Dev and/or User mailing lists for 
at least 6 months and has been relatively active (say, at minimum, 2 
posts per week total).  Any qualified person is eligible for nomination, 
or to nominate someone else.  Naturally, a person could never nominate 
themselves.  A nomination must then be seconded by another qualified 
person.  At that point, a voting period of one week commences, where any 
non-committer and non-PMC member, qualified or not, may vote (the 
usual +1, 0, -1).  The original nominator is responsible for tallying 
the vote.  A person must receive at least 60% +1's (i.e., 6 out of 10 
must be +1) and no more than half of the remainder may be negative.  At 
the end of that one week period, the vote results will be posted to the 
Dev list and a similar one week period will commence where existing 
Struts team members vote for the nominee.  Also note that at any point, 
the nominee can decline the nomination.  We wouldn't want to offer 
someone up that doesn't want to job!


* Conclusion:
Once again, let me make perfectly clear that the existing PMC still 
retains 100% control over who is invited to join.  This proposal only 
serves to introduce a mechanism by which members of the community can be 
nominated and force a vote by the PMC.  That is of course the first 
important principle of this proposal.  The other important principle is 
taking the will of the community into account.  By having the PMC not 
vote until AFTER the community has voted, the will of the community 
should be apparent, and the idea is that the PMC will take that into 
account when voting.  The community will then have a clear indication 
whether they have been listened to or not based on the outcome of the 
vote (and the comments made during the vote because, after all, there 
ould be legitimate reasons not to adhere to the community's vote, and 
hose reasons should come out in discussion).  But, at the end of the 
day, who is invited to join is still decided by the PMC, as it is today.



I look forward to feedback.  Thanks for listening!

Frank

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



Re: Proposal for change

2006-04-24 Thread Craig McClanahan
On 4/24/06, Frank W. Zammetti [EMAIL PROTECTED] wrote:


 I look forward to feedback.  Thanks for listening!


Without commenting on the merit of the proposal itself, or the reasoning
presented as its justification, it is important to note that we (the Struts
community) do not have free reign to do whatever we want in this regard.  As
part of Apache, the Struts community is accountable to the Apache Software
Foundation's Board of Directors, and one of the things that gets watched is
how well the various projects implement the Apache Way.  And one of the
key tenets of that way is how new committers get selected.

Regardless of the details, anything along the general lines of what you
describe would be quite different from the way Apache has grown from the
very beginning to what it is today -- and it would, therefore, be looked at
with a *lot* of skepticism by Apache as a whole.  Trying to argue that the
Apache Way is flawed, and needs to be fundamentally changed like this, does
not seem likely (to me) to get much agreement Apache wide, given the ASF's
history, and the success of many of its projects at building communities of
committers that buy in to that culture -- and, by the way, produce some
pretty popular software to boot.

So what the heck is this Apache way thing?  It is a culture; a way of
gathering a community that interoperates ... and it can be tough at times to
write down a descrption that makes sense.  But [1] is a pretty good starting
point.  I'd also recommend looking through the documentation for the
Incubator Project (where a specific exit criteria is that the folks
participating in the new project get it about the Apache way).

Frank


Craig

[1] http://www.apache.org/foundation/how-it-works.html

PS:  If you like the code but don't like the community, one of the best
things about Apache is that the license gives you the right to fork and
build your own community, operated according to whatever rules please you.
So, even if a proposal like this is not accepted, you still have the
opportunity to go build a better Struts -- that doesn't have to be done
here.


Re: friday ha ha

2006-04-24 Thread Dakota Jack
I am amazed you got it too.  Thanks, Newton.  I thought you were tight with
Ted no matter what.  Nice to see you have a mind of your own.

On 4/22/06, Dave Newton [EMAIL PROTECTED] wrote:

 Dakota Jack wrote:
  On 4/20/06, Ted Husted [EMAIL PROTECTED] wrote:
 
  Yes, we have. Here's a handy summary for future reference:
 
  Translation: do not deign to bother Oz with this rubbish again.
 

 HOLY CRAP SOMEBODY GOT IT!!! And it was YOU!!!

 Perhaps I've been too hard on you, old bean.

 Dave



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




--
You can lead a horse to water but you cannot make it float on its back.
~Dakota Jack~


Re: friday ha ha

2006-04-24 Thread Dakota Jack
Busschots, you and Newton are really the worst on this list.  You never have
code or ideas, only c-r--a---p.

On 4/22/06, Bart Busschots [EMAIL PROTECTED] wrote:

 Jonathan Revusky wrote:
  Ted Husted wrote:
  On 4/19/06, Alexandre Poitras [EMAIL PROTECTED] wrote:
 
  Second, all the comitters have answered your questions very nicely
 
 
  Yes, we have.
 
  I don't know whether you actually believe this in your own mind.
  However, there is a complete electronic archive of this forum and I
  don't think that examining it would support this view.
 
  Here is what I think someone would find by examining the archive.
  Whenever certain pointed questions are posed, one of two things happens:
 
  (1) The person being posed the question simply walks away from the
  discussion. This has happened at least a couple of times in
  conversations where I have asked you to clarify points you have made,
  Ted. This is also the approach Niall Pemberton has used a couple of
  times. You write something, and then when somebody brings up
  counter-arguments are asks you to clarify one or more of your points,
  you  just walk away from the discussion.
 
  The other thing that frequently happens is this:
 
  (2) The other person (or sometimes a proxy) resorts to illegitimate
  ad-hominem discourse to dodge the perfectly legitimate question being
  posed. This is the approach used at different times by James Mitchell,
  Steve Raeburn, and Craig McClanahan.
 I see things a little different:

 1) Someone says they'd like to use Struts

 2) Jack or Jon lambast struts and re-pose their standard question with
 their standard opinion and lable it all as fact rather than opinion.

 3) The developers ignore them for a while because we've been round this
 roundabout a million times before

 4) Jack or Jon insult the developers for not answering their questions
 repeatedly

 5) The developers eventually get fed up with the crap on the list an DO
 answer the question

 6) Jack and Jon insist the developers are wrong, say they still haven't
 answered the question and the cycle continues

 The ultimate irony is that the developers also get lambasted for being
 too slow yet are expected to waste hours of their time trawling through
 mindless drivel that is constantly repeated over and over again by
 people WHO DON'T CONTRIBUTE. I don't see Jon  Jack answering users
 questions yet I do see them constantly and continuously attacking struts
 and attacking the struts team. You've made your point lads, we're sick
 of hearing it. If you are going to keep complaining that struts sucks DO
 SOMETHING TO HELP or just leave us all alone. My mail client has started
 to label your posts to this list as spam which says something. Even
 crude AI can see that you are not contributing anything useful.

 Finally, Ted  co, thanks for your long posts in reply to these trolls,
 I, as a struts user, appreciate them and am happy with them. Keep up the
 good work and don't let the two grumpy old men get you down.

 I am also aware that this post is not really that useful so this will be
 my only contribution to this 'discussion'.

 Bart.

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




--
You can lead a horse to water but you cannot make it float on its back.
~Dakota Jack~


Re: Tiles vs. jsp:include + XHTML/CSS

2006-04-24 Thread Rick Reumann

Michael Jouravlev wrote:


So, the question I am asking: what are the real benefits of using
Tiles if I use JSP includes + XHTML/CSS for layout/styling? Can most
of Tiles features be implemented with XHTML/CSS?


I guess some of it comes to a personal preference in regard to the 
dynamic content stuff that I didn't see you mention (or I read over your 
post too quickly).


For example what about things where your header section needs a title 
to display in the html, or what if you quickly want to change around 
what pages get 'injected' (for lack of a better word) with a particular 
div? To accomplish this without something like tiles, you 1) have to set 
up certain things in the request in your Action before you go to your 
page and  2) you have to have jstl logic to decide whether or not to 
display the information. Personally I find it much cleaner to have this 
stuff defined in one place. So for example, lets look at your master 
layout...


jsp:include page=masterLayout.jsp
div class=content
//all your content
/div

masterlayout.jsp

div class=headerjsp:include page=header.jsp//div
div class=footerjsp:include page=footer.jsp//div

header.jsp
--
SOME COOL LOGO

{ Dynamic MY SUPER TITLE }

SOME OTHER LOGO
more other images
---

Now in the above, how are you going to get your title into this header 
jsp? The only way I know of is that you'd have to set it up ahead of 
time in your action. What if someone decides that title needs to change? 
Personally I'd rather find all the titles in one place 
(tiles-definitions.xml) than have to find what Action it it is in and 
where in the Action you set it up.


Actually tiles just saved me a lot of time in a project I'm working on 
where each of the pages belongs to a certain tab section For example, 
'post' is a link on the menu bar which is part of the notification tab 
section. Because the business requirements changed so much laying out 
this stuff was so easy as the powers-that-be changed their mind about 
what should be part of what tab ragion. Since you can extend layouts, it 
was a quick change to extend a different tab-layout in the 
tiles-definitions.


Also, another thing I like is when I want to change the layout of a page 
very quickly. For example, I often have a popup layout (doesn't 
contain the header and footer and other decoration). If I want to 
quickly change the resulting page to use this layout, it's a 1 second 
change in my tiles-definitions. This becomes even more clean when 
sometimes this page has the popup layout but other times the page is 
used with the normal layout. Using Tiles you can set up a definition as 
yourpage.popup  and yourpage.normal. Now, in your struts-config you 
might have action mappings that foward to popup and normal - the 
content never changes - only the layout. To me this is more clean than 
having JSTL logic in the JSP page to decide whether or not to display 
certain things. At any given time I can quickly change my mind and it's 
super easy... I simply modify one definition file instead of stripping 
out or putting back in JSTL logic to hide or show sections.


The other thing is that I'm still not convinced of the magic and wonders 
of css for layout. Personally to me it's often black magic voodoo. Sure, 
I'm sure some will say it's easy ...bla blah... BS I say. Complex 
layouts with css is ANYTHING but easy or intuitive. Sure for simple 
stuff it's fine, but I'll be willing to race almost any average css user 
in designing some complex layouts. They can use only css and divs. I can 
use tables. I bet you I'll be done much faster and it'll work in all 
browsers and it will be easy to understand (ok yes it will 'look' more 
cluttered, but it'll still be intuitive.) Ok done ranting about css 
positioning:)


Lastly, I think sitemesh is great, but I've haven't checked in a while 
to see if they still buffer everything before outputting the displaying. 
This was a huge performance hit in my last application since we had some 
 huge (yes, arguably, too large) reporting jsps. Last time I used 
Sitemesh, sitemesh looked like it still had to hold everything in a 
buffer before decorating. You can imagine the memory problem that could 
occur for some very large jsps. If Sitemesh fixed this one problem, I'd 
use it over Tiles.


PS: when you mention:

Michael
%@ taglib uri=http://struts.apache.org/tags-tiles; prefix=tiles %
tiles:insert template=layout.jsp
  tiles:put name=title  value=This is the title. /
  tiles:put name=header value=header.jsp /
  tiles:put name=body   value=body.jsp /
/tiles:insert

I still have to specify all these tiles:put tags that refer to
particular header/footer files (Definition solves that, see below).
 /michael

The all these tiles:put things in the above is only true for things 
that 'change' like the body.jsp and the title. Probably things like the 
header and footer would be part of the main.layout which you would be 
extending in your 

Re: Proposal for change

2006-04-24 Thread Craig McClanahan
On 4/24/06, Frank W. Zammetti [EMAIL PROTECTED] wrote:

 * Rationale
 One of the issues that a number of people seem to have with the way
 Struts has progressed is the seeming inability (or difficulty at least)
 of getting new blood involved.  There seems to be a perception by many
 that there is a bit of a closed club mentality with regard to being
 invited in as a committer and that the Struts community at large has no
 say in the matter.


The latter statement is, as mentioned in my previous response, the way that
*all* projects at Apache work -- it is not unique to Struts.  Any claim that
all of Apache is broken in this regard is going to be, umm, unlikely to be
agreed with :-).  What's more interesting is to examine the former
statement, and compare it to the facts.

The Who We Are page[1] lists the current folks who are on the PMC (and
also have committer privileges), and who are committers not on the PMC.
There's 14 and 13 names, respectively, giving a total of 27 (and this
doesn't count the 10 previous committers who are now on the emeritus list,
for a total of 37).  That's a pretty good size number, compared to the
average at Apache.  But what is really interesting is to look at the timing
of how we got from one committer (me) six years ago, to where we are today
-- and focus especially on the more recent changes.

In just the last year there have been quite a number of new committers
added[2] ... six independent of the WebWork merger (Wendy, Gary, Greg,
Shawn, Laurie, and Richard), two more (Jason and Patrick) directly because
of the merger, and five more who have commit rights to the WebWork incubator
code and will become Struts committers as soon as it graduates.  There is
also one outstanding invitation that, for personal reasons fo the individual
involved, will be accepted later rather than now.  That is a pretty large
percentage increase for a single year, even discounting the merger -- and
have you ever seen other competing communities come together like this?
Hmm ... doesn't seem like the existing community is particularly closed to
new blood to me.

Examining how the new folks got themselves nominated and elected is also
interesting.  In every case, it was based on continuous contributions of
code, documentation, user list help, build script maintenance, or whatever
made a *positive* difference for everyone.  Indeed, if you go back to the
days when folks like Ted and Martin were added, a lot of it was being tired
of applying all the patches they were contributing :-).  All of these folks
get it -- so it is not just a couple of dictatorial snobs sitting on top
of the mountain dictating who is in and who is out :-).

There is also another interesting observation here -- you don't have to be a
committer to initiate changes to the Struts code base.  What you have to do
is justify your bugfix or RFE to the point where an existing committer is
willing to take responsibility for cleaning up any messes that committing
the change might cause.  So, you only have to convince one of the various
folks to get your patch in.  Failure to succeed in that goal *could* be a
close minded community, but it also just might be that the proposed change
doesn't fit with what the committers as a whole have in mind (it only takes
one commiter -1 to make a committed change get reversed, so we pay attention
to this as part of the decision process on accepting a patch).  Just in the
little time I have had to spend on Struts in the last year, I've committed
patches from at least 20 different people.  Spread across the six years that
Struts has existed, and all the committers who have done the same thing, we
are talking many *hundreds* of people who have contributed at least some
code or documentation to what is now Struts.

I just don't buy the presumption that the current system is broken.  I won't
presume to convince *you* to think that way -- it's your perogative to think
whatever you want -- but I will certainly take into account whether someone
gets it before I would ever vote for them to be a committer.

Fortunately for those who either don't, or don't want to, buy into this, the
Apache license gives you the freedom to take the code and go start your own
community, operating according to your own rules, if you don't like the way
things work here.  But you are starting from a rationale that does not match
the objective facts, so I'm not even going to be interested in trying to
hash out details of how to change something that does not need to be
changed.

Craig

[1] http://struts.apache.org/volunteers.html
[2] http://struts.apache.org/announce.html