Re: ActionErrors/ActionMessages

2003-10-28 Thread Keld Hansen
I tried your suggestion, and sad to say: it didn't work.
I see that you're using EL - do I have to specify anything special in my jsp page to 
make it work? 
Apart from the usual taglibs.

/Keld
- Original Message -

DATE: Mon, 27 Oct 2003 14:56:08
From: Adam Hardy [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Cc: 

On 10/27/2003 12:47 PM Keld Hansen wrote:
 Thanx, I'll try it, but I read your suggestion as this:
 
 write out all global messages in the ActionMessages queue
 
 so I'll be surpised to see the messages from the Validator.

I'm just telling you what I'm doing :) - there's no reason why it 
shouldn't work for you.

-- 
struts 1.1 + tomcat 5.0.12 + java 1.4.2
Linux 2.4.20 RH9

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






Enter for a chance to win one year's supply of allergy relief!
http://ad.doubleclick.net/clk;6413623;3807821;f?http://mocda3.com/1/c/563632/125699/307982/307982
This offer applies to U.S. Residents Only

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



Re: Unit Test Actions

2003-10-28 Thread Manish Singla
Yes, you can and that is what is true definition of unit testing.

My two cents:
Look for In Container testing while testing Servlets, EJBs, and Struts (Actions). It
may be little difficult to generate all objects generated automatically by containers
(Servlet/EJB) and frameworks(Struts)..


Steven Woody wrote:

 Hi, list

 Can I unit test Action subclasses with JUnit without running of a Servlet container?

 --
 Steven Woody
 [EMAIL PROTECTED]


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



Unit Test Action

2003-10-28 Thread Steven Woody
Hi, list

Can I unit test Action subclasses with JUnit without running of a Servlet container?


--
Steven Woody
[EMAIL PROTECTED]

Re: Unit Test Actions

2003-10-28 Thread Steven Woody

- Original Message - 
From: Manish Singla [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Tuesday, October 28, 2003 3:46 PM
Subject: Re: Unit Test Actions


 Yes, you can and that is what is true definition of unit testing.
 
 My two cents:
 Look for In Container testing while testing Servlets, EJBs, and Struts (Actions). 
 It

But the In Container testing IMHO means it need to run a container.   So, to test a 
Action, I have to equipment a In Container testing suit such as Cactus which run a 
Tomcat, right?

 may be little difficult to generate all objects generated automatically by containers
 (Servlet/EJB) and frameworks(Struts)..

... So, what do i do ?

 
 
 Steven Woody wrote:
 
  Hi, list
 
  Can I unit test Action subclasses with JUnit without running of a Servlet 
  container?
 
  --
  Steven Woody
  [EMAIL PROTECTED]
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

Re: ActionErrors/ActionMessages

2003-10-28 Thread Adam Hardy
On 10/28/2003 08:17 AM Keld Hansen wrote:
I tried your suggestion, and sad to say: it didn't work. I see that
you're using EL - do I have to specify anything special in my jsp
page to make it work? Apart from the usual taglibs.
/Keld - Original Message -

DATE: Mon, 27 Oct 2003 14:56:08 From: Adam Hardy
[EMAIL PROTECTED] To: Struts Users Mailing List
[EMAIL PROTECTED] Cc:

On 10/27/2003 12:47 PM Keld Hansen wrote:

Thanx, I'll try it, but I read your suggestion as this:

write out all global messages in the ActionMessages queue

so I'll be surpised to see the messages from the Validator.
I'm just telling you what I'm doing :) - there's no reason why it 
shouldn't work for you.
OK so I was wrong, there is a reason why it shouldn't work for you :(

I am using DynaValidator - but I can't imagine that it would cause this 
difference.

Actually I've just discovered that there are pages in my app where the 
validator messages are not showing up - but there are pages, e.g. the 
one I checked yesterday before I answered your question, where the 
validator messages do turn up.

I'll see what on earth is going on  let you know.

Adam



--
struts 1.1 + tomcat 5.0.12 + java 1.4.2
Linux 2.4.20 RH9
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: requiredif

2003-10-28 Thread Ruben Orta Magan

- Original Message - 
From: Marc Dugger [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]


 The new validwhen validation rule, which will be included into the Struts
 release immediately after the 1.1 release...

 I am using the nightly build to develop my app and am hoping 1.2 will be
 release by the time I'm ready to deploy.  So far, validwhen is operating
as
 promised.  I haven't run into any problems, but you may search the
archives
 to view other opinions.

How I can download the nightly build version?

Thanks


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



Re: bye thank you

2003-10-28 Thread Sergey Smirnov
David,

If you leave the list just because of the trafic, it is probably a good
alternative to subscribe a gmane.comp.jakarta.struts.user group on
news.gmane.org. It is the same list, but delivered via news-server. You can
read it ofter or occasionally. New messages come, the old ones are removed
automatically.

Regards,
Sergey Smirnov


David Thielen [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Hi;

I'm leaving the list but I wanted to say thank you to all that helped.

And a plea to one of the struts experts - the world desperately needs a
struts cookbook. ie, if you want to do X, here is how. The top 40 or 50 of
those items would be wonderful (and cut down on traffic a lot).

thanks - dave




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



AW: bye thank you

2003-10-28 Thread Frédéric Dreier

I don't know, but perhaps there exists some wiki-style repository for
struts? Or perhaps it would be time to organise one...




-Ursprüngliche Nachricht-
Von: David Thielen [mailto:[EMAIL PROTECTED]
Gesendet: Dienstag, 28. Oktober 2003 02:36
An: Struts-Users
Betreff: bye  thank you


Hi;

I'm leaving the list but I wanted to say thank you to all that helped.

And a plea to one of the struts experts - the world desperately needs a
struts cookbook. ie, if you want to do X, here is how. The top 40 or 50 of
those items would be wonderful (and cut down on traffic a lot).

thanks - dave


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



Datasources Tomcat/Struts

2003-10-28 Thread Mathieu Grimault
Hello, next to my question about deprecation, i've try to make Tomcat JNDI Datasource 
working without success... I  followed the How-to but nothing goes well. 

My configuration is : 
- Tomcat 4.1.27
- JDK 1.4.2
- Struts 1.1
- MySQL 4

When i try to make a request on the database i've got : 
Cannot load JDBC driver class 'null'
this error come from the line : 
Connection conn = ds.getConnection();

(Code is a copy and paste from the how to)

I think that tomcat cannot found the JDBC drivers. My jars ( commons-collections, 
common-dbcp, common-pool, mm.mysql) are in the CATALINA_HOME/common/lib

Treeview

2003-10-28 Thread Davide Caruso
Hi,
i've to insert a treeview structure in my application based from data that are coming 
from a db?
There are some tags that can be useful (except struts-layout )??
There are smarter solutions than use a treeview?


Best regards. 

Davide Caruso
[EMAIL PROTECTED]
2003-10-28



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



Re: Index properties (once again)

2003-10-28 Thread Mark Lowe
That's okay Rajat as I said I know what its like to up against the 
wire..

I've found ArrayList works better in dynaActionForms especially if 
you're dynamically generating forms. I think this because its a big fat 
pain in the arse to create new dynabeans (have a play with bean utils 
for a day and you find this out).

When setting the size dynamically you need to scope the form to session.

action path=/myaction scope=session ..

I use arraylist as the form property type, i don't think that arrays 
work but i could be wrong

form-property name=myprop type=java.util.ArrayList /
[notice you dont set the size]
then in your action when your loading the form

ArrayList list = ...

theForm.set(myprop,list);

and also (I guess this shouldn't be required but it is)...

request.setAttribute(myprop,list);

then

logic:iterate id=prop name=myForm property=myprop
html:text name=prop property=foo indexed=true /
/logic:iterate
I guess you could apply the same principles using non dynamic action 
form. I imagine that using an array rather than arrayList should work 
too.

Cheers Mark

On Tuesday, October 28, 2003, at 02:31 AM, Rajat Pandit wrote:

Hello all,
I finally managed to solve the problem, and now that I know it all 
seems
so damn awfully simple!!! , I wish the docs had explained it in a much
simpler manner. But I guess it was more about the form and ActionForm
thing than about the indexed properties. I am writing a HOWTO on all
possible variations of indexed properties now. Shall post it on the
mailing list for your review.
Thanks a lot nick, for the pointers, it was a great help.

Just one more question, it works just fine if I define it as an
ArrayList, but in case I want to use it as an array, how do I 
workaround
for the size. One way is to assume a higest upper limit. (which I think
is lame) Is there someone I can inform the actionForm about the last
value of the index of the logic:iterate.. Tag ... I mean this could
sound rather silly...but just to know is there a possibility?

Thanks again for all ur time. And yes mark! Thanks for all the kick in
the butt!! Helped me think rationally :D
-Original Message-
From: Rajat Pandit [mailto:[EMAIL PROTECTED]
Sent: Sunday, October 26, 2003 9:39 PM
To: [EMAIL PROTECTED]
Subject: Index properties (once again)
Hello sorry for posting the same question again and again. But I seem 
to
have gained something on this. Now I have a few (more) questions. Maybe
someone could help me figure out what or where I am getting it wrong.

This is the case. I have a product, with different states(checbox) and
each state has to have a bidAmount (text area) and a transaction
type(radio button). I want the form to be generated such that for
validation.
a. I can check If the checkbox(for the state) has been checked the
bidAmount and transaction type has been selected.
Now my question is,
a. in the action form. Do I need to defind the bidAmount as an array
b. I didn't know about this until know, but are only String type 
allowed
in actionform ( ihavent read about this anywhere except on one of the
posts in this mailing list) c. I have set the setter and getter for
(lets take the example of bidAmount only) like this.

public String getBidAmount(int index) {
String tmp = new String();
System.err.println(Value of index:  + index);
try {
tmp = bidAmount[index];
} catch (Exception e) {
System.err.println(Error:  + e.getMessage());
}
return tmp;
}

public void setBidAmount(int index, String value) {
System.err.println(index:  + index);
System.err.println(Value:  + value);
System.err.println(--);
this.bidAmount[index] = value;
}


And the corresponding jsp tags as follows.

logic:iterate id=state name=STATES indexId=currIdx

tr bgcolor=#F8F8F8
  td align=left valign=top
html:multibox property=stateId styleClass=flat
bean:write name=state property=id /
/html:multibox bean:write name=state property=name 
/
  /td
  td 
html:text name=bidForm
property='%=bidAmount[+currIdx+]%'  styleClass=flat size=3  
/
  /td

  td align=center
BC html:radio name=bidForm property=mode value=2
titleKey=app.bcall  indexed=true styleClass=flat /
| SC html:radio name=bidForm property=mode value=1
titleKey=app.scall  indexed=true  styleClass=flat /
  /td
  td align=right
bean:write name=state property=buyingCall 
ignore=true
/
  /td
  td align=right
bean:write name=state property=sellingCall
ignore=true /
   /td

/tr
/logic:iterate


I know the the inline scriptlet is very ugly, but this was the only way
I could get it to call the index number in the getter method. However
the desperate attempt (try and catch) makes the form work (not much 

Re: GURU NEEDED: Tiles Definitions and new ActionForward(TILES_DEFINITION_NAME);

2003-10-28 Thread Ted Husted
Technically, it will return an ActionForward with the path set to the 
String passed as TILES_DEFINITION_NAME. Later, the RequestProcessor 
would check to see if the path matches the name of the Tiles definition 
before using it as an URI. Of course, you have to have Tiles configured 
and all that.

Often the best thing is to just jump in and try something like this 
yourself. If you don't have a working application open, install one of 
the many examples and play with that. The best way to learn Struts can 
be to just roll-up your sleeves and start trying things.

Micael wrote:
If I return new ActionForward(TILES_DEFINITION_NAME);, will that 
return the page the definition defines?  This is seemingly so.  If so, I 
can dynamically choose definitions in the Action and not bother with 
either global forwards or defining forwards in action mappings.  Is that 
right?

I would really appreciate an answer to this from some guru.  Thanks 
ahead of time.

Micael


--
Ted Husted,
  Junit in Action  - http://www.manning.com/massol/,
  Struts in Action - http://husted.com/struts/book.html,
  JSP Site Design  - http://www.amazon.com/exec/obidos/ISBN=1861005512.


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


Re: Unit Test Actions

2003-10-28 Thread Ted Husted
Steven Woody wrote:
 Can I unit test Action subclasses with JUnit without running of a
 Servlet container?
http://strutstestcase.sourceforge.net/



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


Re: ActionErrors/ActionMessages

2003-10-28 Thread Keld Hansen
Great Adam,
I really appreciate your info.
BTW: I saw in the struts-dev newsgroup that there are some discussions about how to 
get rid of ActionErrors, and apparantly it's not crystal clear what will happen. 
Anyway I didn't find useful information about the Validator. 
I've given up experimenting, and must -- until new ideas pop up -- stick to the old 
ActionErrors class. [I don't like the name of the class--it's supposed to hold any 
type of message - right? :-) ]
/Keld

--

- Original Message -

DATE: Tue, 28 Oct 2003 09:03:26
From: Adam Hardy [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Cc: 

On 10/28/2003 08:17 AM Keld Hansen wrote:
 I tried your suggestion, and sad to say: it didn't work. I see that
 you're using EL - do I have to specify anything special in my jsp
 page to make it work? Apart from the usual taglibs.
 
 /Keld - Original Message -
 
 DATE: Mon, 27 Oct 2003 14:56:08 From: Adam Hardy
 [EMAIL PROTECTED] To: Struts Users Mailing List
 [EMAIL PROTECTED] Cc:
 
 
 On 10/27/2003 12:47 PM Keld Hansen wrote:
 
 Thanx, I'll try it, but I read your suggestion as this:
 
 write out all global messages in the ActionMessages queue
 
 so I'll be surpised to see the messages from the Validator.
 
 I'm just telling you what I'm doing :) - there's no reason why it 
 shouldn't work for you.

OK so I was wrong, there is a reason why it shouldn't work for you :(

I am using DynaValidator - but I can't imagine that it would cause this 
difference.

Actually I've just discovered that there are pages in my app where the 
validator messages are not showing up - but there are pages, e.g. the 
one I checked yesterday before I answered your question, where the 
validator messages do turn up.

I'll see what on earth is going on  let you know.

Adam



-- 
struts 1.1 + tomcat 5.0.12 + java 1.4.2
Linux 2.4.20 RH9

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






Enter for a chance to win one year's supply of allergy relief!
http://ad.doubleclick.net/clk;6413623;3807821;f?http://mocda3.com/1/c/563632/125699/307982/307982
This offer applies to U.S. Residents Only

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



Re: How to find out all of pages (links) in a directory on website.

2003-10-28 Thread Ted Husted
At this point, we're definitely moving into Lucene territory.

http://jakarta.apache.org/lucene/docs/index.html

-T.

Dinh Nguyen wrote:

Hi Rajat/all,

The thing is, I need to detect which files and how many files, that contain word Privacy, on a directory on a website.  
Assume that, http://www.xyz.com is a live site, and myfolder is one of the directories on the site (http://www.xyz.com/myfolder.html).  This folder contains some files that are privacy.  I don't know how many files are there, and I don't know which file that contains word Privacy.  
I think that there are steps: 
1) Implement a small Java program/class that dectects if a certain word appears on a file or not.
2) Implement a smalll Java program/class that lists (and counts) all of the URLs/links (or/and sub-folders) that from a URL (given URL) has.  
I got step 1 done already and I am stuck at step #2.

I know that Sun has one of those examples, I downloaded it, compiled it, but it gave me errors at the line == ListlistMatches; 
http://developer.java.sun.com/developer/technicalArticles/ThirdParty/WebCrawler/#demo

I wasn't able to this compile.  I am not sure that if anyone ran into this problem before.

Thanks,
Dinh Nguyen
Rajat Pandit [EMAIL PROTECTED] wrote:
The solution also depends on the fact that you want to explore a
remote file or a local file. For local files, I belive using the DOM is
the best option to solve the problem. (see javascript for more info). 
-Original Message-
From: Dinh Nguyen [mailto:[EMAIL PROTECTED] 
Sent: Monday, October 27, 2003 8:30 PM
To: [EMAIL PROTECTED]
Subject: How to find out all of pages (links) in a directory on website.

Hi all,

I know that this is probably not a right place to ask the question, 
but I am sure that there are some experts on this forum knows the 
answer. Here is the question:

I am about the write a program to list (and count) all of the pages 
(URL) in a directory from a website.
Let say, given a URL below:
http://www.xyz.com/myfolder
or http://www.xyz.com 
there are lots of directories, each directory has number of pages. 
So in this case, let say there are five pages located in myfolder 
directory. I'd like to find out those five URLs or links, for 
example:
http://www.xyz.com/myfolder/page1.html
http://www.xyz.com/myfolder/design.doc
http://www.xyz.com/myfolder/faqs.html
http://www.xyz.com/myfolder/links.htm
http://www.xyz.com/myfolder/mynews.html

How would I do this? Can you please guide me step by step (or some 
ideas) to design this program?

Thanks for your help.
Dinh Nguyen
--
Ted Husted,
  Junit in Action  - http://www.manning.com/massol/,
  Struts in Action - http://husted.com/struts/book.html,
  JSP Site Design  - http://www.amazon.com/exec/obidos/ISBN=1861005512.


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


Exception handling - please help!

2003-10-28 Thread Bård Arve Evjen
Hi,

I'm trying hard not to rip out hair from my scalp. I cannot get the exception handling 
in struts to work. What am I doing wrong? Please help me before I go insane...

I have an action that contains:

ActionMessages actionMess = new ActionMessages();
ActionMessage error = null;

in the start of the action and:

try {
ITradeProvider provider = (ITradeProvider) 
ProviderInit.getProvider(ITradeProvider.class);
IReportExportProvider reportProvider = (IReportExportProvider) 
ProviderInit.getProvider(IReportExportProvider.class);

// Remove values before run
request.getSession().removeValue(CheckSession.SESSION_REPORTTYPES);

TradeRec[] trades = provider.fetchTrades(ti);
TradeHolder th = new TradeHolder(trades);

request.getSession().putValue(CheckSession.SESSION_TRADES, th);
} catch (Exception e) {
if (e instanceof CondicoException) {
error = new ActionMessage(web.trade.jsp.no.records);
actionMess.add(trades, error );
}
if (e instanceof NullPointerException) {
error = new ActionMessage(web.trade.jsp.no.records);
actionMess.add(trades, error );
}
error = new ActionMessage(web.trade.jsp.error);
actionMess.add(trades, error );
saveMessages(request, actionMess);
}

return mapping.findForward(ResultTrade);

-
in the jsp-file I have:

logic:messagesPresent
bean:message key=errors.header/
html:messages id=error
  libean:write name=error property=%=error%//li
/html:messages
hr
/logic:messagesPresent

logic:messagesPresent message=true
   html:messages id=message message=true
 bean:write name=message property=%=message%/br
   /html:messages
/logic:messagesPresent

---
and in the struts-config.xml file:

action path=/SearchTrades
type=com.om.condico.webclient.servlet.SearchTradesAction
name=SearchTradesForm
scope=request
validate=true
input=/trade/index.jsp
exception
key=web.trade.jsp.no.records
type=com.om.condico.util.exception.CondicoException
path=/trade/result.jsp/
exception
key=web.trade.jsp.error
type=java.lang.Exception
path=/trade/result.jsp/
exception
key=web.trade.jsp.no.records
type=java.lang.NullPointerException
path=/trade/result.jsp/
forward name=ResultTrade path=/trade/result.jsp/
/action

--

What am I doing wrong?

Cheers,
Bard
-- 
___
OperaMail free e-mail - http://www.operamail.com
OperaMail Premium - 28MB, POP3, more! US$29.99/year

Powered by Outblaze

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



dynaactionform values to a bean

2003-10-28 Thread Frers Michael
Hello

i try to get Values from a dynaactionform to a bean
but BeanUtils.copyproperties(...,...); doesnt work;

How can i do this in an easy way?
Looking in my logfile says that the value is in the DynaActionForm but not
in the bean after copying

My Ressources:
#
DynactionForm:
#
form-bean
name=SearchForm
type=org.apache.struts.validator.DynaValidatorForm
form-property
name=searchString
type=java.lang.String/
/form-bean
#
The Bean:
#
public class SearchValues {
private String searchString=;

public String getSearchString() {
return searchString;
}
public void setSearchString(String iStringi) {
searchString = iStringi;
}
}
#
And my try to copy the Value in my Action:
#
DynaActionForm formBean = (DynaActionForm)form;
String searchString = (String) formBean.get(searchString);
SearchValues searchBean = new SearchValues();
BeanUtils.copyProperties(formBean,searchBean);
//PropertyUtils.copyProperties(...) didn't work neither
String newsearchString = (String) searchBean.getSearchString();

_Log.debug(DynaActionFormSearchstring+searchString);
_Log.debug(BeanSearchString+newsearchString);

#
My Log entries look like (if i enter thisismysearchterm):
#
DEBUG Thread-5 org.apache.commons.beanutils.BeanUtils -
BeanUtils.copyProperties(DynaActionForm[dynaClass=SearchForm,searchString=th
isismysearchterm], [EMAIL PROTECTED])
DEBUG Thread-5 org.apache.commons.beanutils.BeanUtils -
copyProperty(DynaActionForm[dynaClass=SearchForm,searchString=thisismysearch
term], searchString, )
DEBUG Thread-5 org.apache.commons.beanutils.BeanUtils - target
propName=searchString, type=class java.lang.String, index=-1, key=null
DEBUG Thread-5 org.apache.commons.beanutils.BeanUtils - USING
CONVERTER [EMAIL PROTECTED]
DEBUG Thread-5 com.sisis.webOpac.test.SearchAction -
DynaActionFormSearchstringthisismysearchterm
DEBUG Thread-5 com.sisis.webOpac.test.SearchAction - BeanSearchString
#
so BeanSearchString is still emtpy

Any on knows how i can easy copy the values out of the HashMap from the
DynaActionForm to an existing Bean?
Or do i have to create my own copyproperties method?

Thanks for any help

Michael




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



Re: requiredif

2003-10-28 Thread Koni Roth
http://cvs.apache.org/builds/jakarta-struts/nightly/

Ruben Orta Magan wrote:

- Original Message - 
From: Marc Dugger [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]


The new validwhen validation rule, which will be included into the Struts
release immediately after the 1.1 release...


I am using the nightly build to develop my app and am hoping 1.2 will be
release by the time I'm ready to deploy.  So far, validwhen is operating
as

promised.  I haven't run into any problems, but you may search the
archives

to view other opinions.


How I can download the nightly build version?

Thanks

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


Bean usage

2003-10-28 Thread Rajat Pandit
Hello,
I got a question. 

How come this doesn't work
bean:define id=stateIdVal name=state property=id /
logic:equal name=state property=id
value='%=stateIdVal%'CHECKED/logic:equal


And this does?
html:text name=bidForm
property='%=bidAmount[+currIdx+]%'  styleClass=flat size=3  /

If someone can reply to this asap, I would be really happy. I wnt the
damn checkboxes to retain their state. Any other idea or suggestion
would be really helpful!




Rajat Pandit | [EMAIL PROTECTED]
+91 612 3117606
[ Developer and Part Time Human Being]


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



RE: Index properties (once again)

2003-10-28 Thread Rajat Pandit
I guess its time to learn struts-el, JSTL (remove inline scripting) and
dynaforms!!! Man!! This just never seems to end. The next up challenege
to get the damn checkbox retain their states!!. Using array for checkbox
to retain an ID
Something like this
input type=checkbox value=6name=stateId[0] /
input type=checkbox value=7name=stateId[1] /
input type=checkbox value=8name=stateId[2] /

So which ever checkbox s checked its value is set.
Any clues?

-Original Message-
From: Mark Lowe [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, October 28, 2003 1:09 AM
To: Struts Users Mailing List
Subject: Re: Index properties (once again)


That's okay Rajat as I said I know what its like to up against the 
wire..

I've found ArrayList works better in dynaActionForms especially if 
you're dynamically generating forms. I think this because its a big fat 
pain in the arse to create new dynabeans (have a play with bean utils 
for a day and you find this out).

When setting the size dynamically you need to scope the form to session.

action path=/myaction scope=session ..

I use arraylist as the form property type, i don't think that arrays 
work but i could be wrong

form-property name=myprop type=java.util.ArrayList / [notice you
dont set the size]

then in your action when your loading the form

ArrayList list = ...

theForm.set(myprop,list);

and also (I guess this shouldn't be required but it is)...

request.setAttribute(myprop,list);

then

logic:iterate id=prop name=myForm property=myprop
html:text name=prop property=foo indexed=true /
/logic:iterate

I guess you could apply the same principles using non dynamic action 
form. I imagine that using an array rather than arrayList should work 
too.

Cheers Mark


On Tuesday, October 28, 2003, at 02:31 AM, Rajat Pandit wrote:

 Hello all,
 I finally managed to solve the problem, and now that I know it all
 seems
 so damn awfully simple!!! , I wish the docs had explained it in a much
 simpler manner. But I guess it was more about the form and ActionForm
 thing than about the indexed properties. I am writing a HOWTO on all
 possible variations of indexed properties now. Shall post it on the
 mailing list for your review.
 Thanks a lot nick, for the pointers, it was a great help.

 Just one more question, it works just fine if I define it as an 
 ArrayList, but in case I want to use it as an array, how do I 
 workaround for the size. One way is to assume a higest upper limit. 
 (which I think is lame) Is there someone I can inform the actionForm 
 about the last value of the index of the logic:iterate.. Tag ... I 
 mean this could sound rather silly...but just to know is there a 
 possibility?

 Thanks again for all ur time. And yes mark! Thanks for all the kick in

 the butt!! Helped me think rationally :D


 -Original Message-
 From: Rajat Pandit [mailto:[EMAIL PROTECTED]
 Sent: Sunday, October 26, 2003 9:39 PM
 To: [EMAIL PROTECTED]
 Subject: Index properties (once again)


 Hello sorry for posting the same question again and again. But I seem
 to
 have gained something on this. Now I have a few (more) questions.
Maybe
 someone could help me figure out what or where I am getting it wrong.


 This is the case. I have a product, with different states(checbox) and

 each state has to have a bidAmount (text area) and a transaction 
 type(radio button). I want the form to be generated such that for 
 validation.

 a. I can check If the checkbox(for the state) has been checked the 
 bidAmount and transaction type has been selected.

 Now my question is,
 a. in the action form. Do I need to defind the bidAmount as an array 
 b. I didn't know about this until know, but are only String type 
 allowed in actionform ( ihavent read about this anywhere except on one

 of the posts in this mailing list) c. I have set the setter and getter

 for (lets take the example of bidAmount only) like this.

 public String getBidAmount(int index) {
 String tmp = new String();
 System.err.println(Value of index:  + index);
 try {
 tmp = bidAmount[index];
 } catch (Exception e) {
 System.err.println(Error:  + e.getMessage());
 }
 return tmp;

 }

 public void setBidAmount(int index, String value) {
 System.err.println(index:  + index);
 System.err.println(Value:  + value);
 System.err.println(--);
 this.bidAmount[index] = value;
 }



 And the corresponding jsp tags as follows.

 logic:iterate id=state name=STATES indexId=currIdx

 tr bgcolor=#F8F8F8
   td align=left valign=top
 html:multibox property=stateId styleClass=flat 
 bean:write name=state property=id /
 /html:multibox bean:write name=state property=name
 /
   /td
   td 
 html:text name=bidForm
 property='%=bidAmount[+currIdx+]%'  styleClass=flat size=3  
 /
   /td


Re: Datasources Tomcat/Struts

2003-10-28 Thread virupaksha
Hi Mathieu Grimault,

can you send me ur tomcat's server.xml file, the problem is in tomcat
configuration,

Regards,
viru

- Original Message -
From: Mathieu Grimault [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Tuesday, October 28, 2003 5:01 PM
Subject: Datasources Tomcat/Struts


Hello, next to my question about deprecation, i've try to make Tomcat JNDI
Datasource working without success... I  followed the How-to but nothing
goes well.

My configuration is :
- Tomcat 4.1.27
- JDK 1.4.2
- Struts 1.1
- MySQL 4

When i try to make a request on the database i've got :
Cannot load JDBC driver class 'null'
this error come from the line :
Connection conn = ds.getConnection();

(Code is a copy and paste from the how to)

I think that tomcat cannot found the JDBC drivers. My jars (
commons-collections, common-dbcp, common-pool, mm.mysql) are in the
CATALINA_HOME/common/lib

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



Re: ActionErrors/ActionMessages

2003-10-28 Thread Adam Hardy
On 10/28/2003 10:16 AM Keld Hansen wrote:
Great Adam, I really appreciate your info. BTW: I saw in the
struts-dev newsgroup that there are some discussions about how to get
rid of ActionErrors, and apparantly it's not crystal clear what will
happen. Anyway I didn't find useful information about the Validator.
 I've given up experimenting, and must -- until new ideas pop up --
stick to the old ActionErrors class. [I don't like the name of the
class--it's supposed to hold any type of message - right? :-) ] /Keld
I am using DynaValidator - but I can't imagine that it would cause
this difference.
Actually I've just discovered that there are pages in my app where
the validator messages are not showing up - but there are pages,
e.g. the one I checked yesterday before I answered your question,
where the validator messages do turn up.
I'll see what on earth is going on  let you know.


Hi Keld,
I just discovered that I was in fact not showing any of my validator 
errors. It just goes to show that having javascript validation enabled 
means I had assumed it was working fine for x weeks - but anyway, I 
worked out I needed this taglib to show them:

html:messages id=validatorMsgs
  message=false
   header=errors.header
   footer=errors.footer
  c:out value=${validatorMsgs} /
/html:messages
Since I'm using Tiles though I only had to add this in one place and now 
it's fine again. (Guess I can turn javascript back on in my browser...)

Adam

--
struts 1.1 + tomcat 5.0.12 + java 1.4.2
Linux 2.4.20 RH9
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Antwort: [OT] Re: far reaching db question

2003-10-28 Thread Manuel Lenz
How do preparedStatements handle single quotes and other injection 
attacks?
I changed my db-connection from a normal statement-conding into prepared 
statements.
But the error ist still the same.

Here ist my test-coding:
Connection conn = null;
PreparedStatement prepare = null;
ServletContext context = as.getServletContext();
boolean ret = false;
 
try
{
DataSource ds = (DataSource) 
context.getAttribute(Action.DATA_SOURCE_KEY);
 
// Update Banf-Daten
String sql = update tab_article set ...  
System.out.println (sql);
 
conn = ds.getConnection();
prepare = conn.prepareStatement(sql);
prepare.executeQuery(sql);
}
catch (Exception ex)


Do I need some extra coding for injection attacks, or is this coding 
wrong?

Regards,
Manuel






David Graham [EMAIL PROTECTED]
24.10.2003 17:47
Bitte antworten an Struts Users Mailing List
 
An: Struts Users Mailing List [EMAIL PROTECTED]
Kopie: 
Thema:  [OT] Re: far reaching db question


 I create DB-Inserts from my struts application.
 But If an user types in the sign ' any dynamicly created inserts fail.
 This ist because of the sql-syntax which divides the string which will
 be
 saved with '.
 
 For example: insert into table test (name, number) values ('mr burns',
 '01723256477');
 
 How can I handle inserts in html-formulars which have the typed sign ' ?
 

Always use PreparedStatements.  They handle the ' for you and prevent
other SQL injection attacks.

David

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


__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

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




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



RE: Antwort: [OT] Re: far reaching db question

2003-10-28 Thread Navjot Singh
you should escape your sql data values for mischieveous chars like single
quotes etc.


-Original Message-
From: Manuel Lenz [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 28, 2003 4:33 PM
To: Struts Users Mailing List
Subject: Antwort: [OT] Re: far reaching db question


How do preparedStatements handle single quotes and other injection
attacks?
I changed my db-connection from a normal statement-conding into prepared
statements.
But the error ist still the same.

Here ist my test-coding:
Connection conn = null;
PreparedStatement prepare = null;
ServletContext context = as.getServletContext();
boolean ret = false;

try
{
DataSource ds = (DataSource)
context.getAttribute(Action.DATA_SOURCE_KEY);

// Update Banf-Daten
String sql = update tab_article set ...
System.out.println (sql);

conn = ds.getConnection();
prepare = conn.prepareStatement(sql);
prepare.executeQuery(sql);
}
catch (Exception ex)


Do I need some extra coding for injection attacks, or is this coding
wrong?

Regards,
Manuel






David Graham [EMAIL PROTECTED]
24.10.2003 17:47
Bitte antworten an Struts Users Mailing List

An: Struts Users Mailing List [EMAIL PROTECTED]
Kopie:
Thema:  [OT] Re: far reaching db question


 I create DB-Inserts from my struts application.
 But If an user types in the sign ' any dynamicly created inserts fail.
 This ist because of the sql-syntax which divides the string which will
 be
 saved with '.

 For example: insert into table test (name, number) values ('mr burns',
 '01723256477');

 How can I handle inserts in html-formulars which have the typed sign ' ?


Always use PreparedStatements.  They handle the ' for you and prevent
other SQL injection attacks.

David

 Greetings,
 Manuel



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



__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

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




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




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



RE: Index properties (once again)

2003-10-28 Thread Nicholas L Mohler





Hi Rajat,

You could use an Array.  If your form is in the session, as opposed to the
request, the array will never go away, so the array will retain its size.
I can't do that in our app as our UI presents a spreadsheet and allows
the user to add and remove rows.  For that reason, I use an ArrayList since
I can easily resize it on the fly.

As far as creating an Array with the correct size, I don't believe that we
have any control over the sequence in which Struts populates the
ActionForm.  So we couldn't submit the array size from the browser.

Glad that you found the referenced threads useful :-)
Nick





   

  Rajat Pandit   

  [EMAIL PROTECTED]To:   'Struts Users Mailing 
List' [EMAIL PROTECTED]
  upinc.com   cc: 

   Subject:  RE: Index properties (once 
again) 
  10/27/2003 09:31 

  PM   

  Please respond to

  Struts Users

  Mailing List

   

   





Hello all,
I finally managed to solve the problem, and now that I know it all seems
so damn awfully simple!!! , I wish the docs had explained it in a much
simpler manner. But I guess it was more about the form and ActionForm
thing than about the indexed properties. I am writing a HOWTO on all
possible variations of indexed properties now. Shall post it on the
mailing list for your review.
Thanks a lot nick, for the pointers, it was a great help.

Just one more question, it works just fine if I define it as an
ArrayList, but in case I want to use it as an array, how do I workaround
for the size. One way is to assume a higest upper limit. (which I think
is lame) Is there someone I can inform the actionForm about the last
value of the index of the logic:iterate.. Tag ... I mean this could
sound rather silly...but just to know is there a possibility?

Thanks again for all ur time. And yes mark! Thanks for all the kick in
the butt!! Helped me think rationally :D


-Original Message-
From: Rajat Pandit [mailto:[EMAIL PROTECTED]
Sent: Sunday, October 26, 2003 9:39 PM
To: [EMAIL PROTECTED]
Subject: Index properties (once again)


Hello sorry for posting the same question again and again. But I seem to
have gained something on this. Now I have a few (more) questions. Maybe
someone could help me figure out what or where I am getting it wrong.


This is the case. I have a product, with different states(checbox) and
each state has to have a bidAmount (text area) and a transaction
type(radio button). I want the form to be generated such that for
validation.

a. I can check If the checkbox(for the state) has been checked the
bidAmount and transaction type has been selected.

Now my question is,
a. in the action form. Do I need to defind the bidAmount as an array
b. I didn't know about this until know, but are only String type allowed
in actionform ( ihavent read about this anywhere except on one of the
posts in this mailing list) c. I have set the setter and getter for
(lets take the example of bidAmount only) like this.

public String getBidAmount(int index) {
String tmp = new String();
System.err.println(Value of index:  + index);
try {
tmp = bidAmount[index];
} catch (Exception e) {
System.err.println(Error:  + e.getMessage());
}
return tmp;

}

public void setBidAmount(int index, String value) {
System.err.println(index:  + index);
System.err.println(Value:  + value);
System.err.println(--);
this.bidAmount[index] = value;
}



And the corresponding jsp tags as follows.

logic:iterate id=state name=STATES indexId=currIdx

tr 

Antwort: RE: Antwort: [OT] Re: far reaching db question

2003-10-28 Thread Manuel Lenz
How can I do that?






Navjot Singh [EMAIL PROTECTED]
28.10.2003 12:32
Bitte antworten an Struts Users Mailing List
 
An: Struts Users Mailing List 
[EMAIL PROTECTED]
Kopie: 
Thema:  RE: Antwort: [OT] Re: far reaching db question


you should escape your sql data values for mischieveous chars like single
quotes etc.


-Original Message-
From: Manuel Lenz [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 28, 2003 4:33 PM
To: Struts Users Mailing List
Subject: Antwort: [OT] Re: far reaching db question


How do preparedStatements handle single quotes and other injection
attacks?
I changed my db-connection from a normal statement-conding into prepared
statements.
But the error ist still the same.

Here ist my test-coding:
Connection conn = null;
PreparedStatement prepare = null;
ServletContext context = as.getServletContext();
boolean ret = false;

try
{
DataSource ds = (DataSource)
context.getAttribute(Action.DATA_SOURCE_KEY);

// Update Banf-Daten
String sql = update tab_article set ...
System.out.println (sql);

conn = ds.getConnection();
prepare = conn.prepareStatement(sql);
prepare.executeQuery(sql);
}
catch (Exception ex)


Do I need some extra coding for injection attacks, or is this coding
wrong?

Regards,
Manuel






David Graham [EMAIL PROTECTED]
24.10.2003 17:47
Bitte antworten an Struts Users Mailing List

An: Struts Users Mailing List 
[EMAIL PROTECTED]
Kopie:
Thema:  [OT] Re: far reaching db question


 I create DB-Inserts from my struts application.
 But If an user types in the sign ' any dynamicly created inserts fail.
 This ist because of the sql-syntax which divides the string which will
 be
 saved with '.

 For example: insert into table test (name, number) values ('mr burns',
 '01723256477');

 How can I handle inserts in html-formulars which have the typed sign ' 
?


Always use PreparedStatements.  They handle the ' for you and prevent
other SQL injection attacks.

David

 Greetings,
 Manuel



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



__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

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




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




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




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



Re: [OT] Re: far reaching db question

2003-10-28 Thread vellosa

Try something along these lines:


String sql =  UPDATE my_table SET some_column = ? WHERE key = ? ;

con = ds.getConnection(); 
ps = conn.prepareStatement(sql); 

ps.setString(1, newColumValue);
ps.setInt(2, recordId);

ps.executeQuery(sql); 




  from:Manuel Lenz [EMAIL PROTECTED]
  date:Tue, 28 Oct 2003 12:07:42
  to:  [EMAIL PROTECTED]
  subject: Re: Antwort: RE: Antwort: [OT] Re: far reaching db question
 
 How can I do that?
 
 
 
 
 
 
 Navjot Singh [EMAIL PROTECTED]
 28.10.2003 12:32
 Bitte antworten an Struts Users Mailing List
  
 An: Struts Users Mailing List 
 [EMAIL PROTECTED]
 Kopie: 
 Thema:  RE: Antwort: [OT] Re: far reaching db question
 
 
 you should escape your sql data values for mischieveous chars like single
 quotes etc.
 
 
 -Original Message-
 From: Manuel Lenz [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, October 28, 2003 4:33 PM
 To: Struts Users Mailing List
 Subject: Antwort: [OT] Re: far reaching db question
 
 
 How do preparedStatements handle single quotes and other injection
 attacks?
 I changed my db-connection from a normal statement-conding into prepared
 statements.
 But the error ist still the same.
 
 Here ist my test-coding:
 Connection conn = null;
 PreparedStatement prepare = null;
 ServletContext context = as.getServletContext();
 boolean ret = false;
 
 try
 {
 DataSource ds = (DataSource)
 context.getAttribute(Action.DATA_SOURCE_KEY);
 
 // Update Banf-Daten
 String sql = update tab_article set ...
 System.out.println (sql);
 
 conn = ds.getConnection();
 prepare = conn.prepareStatement(sql);
 prepare.executeQuery(sql);
 }
 catch (Exception ex)
 
 
 Do I need some extra coding for injection attacks, or is this coding
 wrong?
 
 Regards,
 Manuel
 
 
 
 
 
 
 David Graham [EMAIL PROTECTED]
 24.10.2003 17:47
 Bitte antworten an Struts Users Mailing List
 
 An: Struts Users Mailing List 
 [EMAIL PROTECTED]
 Kopie:
 Thema:  [OT] Re: far reaching db question
 
 
  I create DB-Inserts from my struts application.
  But If an user types in the sign ' any dynamicly created inserts fail.
  This ist because of the sql-syntax which divides the string which will
  be
  saved with '.
 
  For example: insert into table test (name, number) values ('mr burns',
  '01723256477');
 
  How can I handle inserts in html-formulars which have the typed sign ' 
 ?
 
 
 Always use PreparedStatements.  They handle the ' for you and prevent
 other SQL injection attacks.
 
 David
 
  Greetings,
  Manuel
 
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 __
 Do you Yahoo!?
 The New Yahoo! Shopping - with improved product search
 http://shopping.yahoo.com
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 -
 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]
 



http://www.amazon.co.uk/exec/obidos/redirect-home?tag=velloscouk-21placement=home_multi.gifsite=amazon

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



Indexed Properties + Validator + JavaScript

2003-10-28 Thread Vara Prasad Reddy
The validations for indexed properties are not fired on the client side,
they are fired on the server side only.

Is there a way I can do that on the client side.

I am working on a PO screen with many line items.

Regards
Vara Prasad


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



How to set and display Messages

2003-10-28 Thread José Gustavo Zagato
Hi Folks !

I have a question regarding how can tell the JSP (witch my
action is forwarding) to grab I18N message form the resource bundle ?
It's not a error message and it the I18N key must be define in the
action.

Thanks !

  José Gustavo Zagato Rosa
System Analyst - Atos Origin
[EMAIL PROTECTED]


-Original Message-
From: Vara Prasad Reddy [mailto:[EMAIL PROTECTED] 
Sent: terça-feira, 28 de outubro de 2003 09:48
To: Struts Users Mailing List
Subject: Indexed Properties + Validator + JavaScript

The validations for indexed properties are not fired on the client side,
they are fired on the server side only.

Is there a way I can do that on the client side.

I am working on a PO screen with many line items.

Regards
Vara Prasad


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



validwhen kills me!

2003-10-28 Thread Ruben Orta Magan
Hello.I've got a problem with validwhen. I've got a form with two buttons.one 
makes and insert in the database, and the other makes a searchI want to make a 
validation only when the insert button is pushed and i don't know if i understand 
correctly how validwhen works.

I've got this form

html:form action=/icytReviAction onsubmit=return validateIcytReviForm(this)

html:text property=name/
html:text property=email/

html:hidden property=act/

html:submit value=alta onclick=javascript:document.forms[0].act.value='insert';/
html:submit value=alta onclick=javascript:document.forms[0].act.value='search';/

/html:form
The hidden input called act that is filled with the word search or insert, the 
value depends of the button you push.

I want to set name as a required field and email has a required, email mask field. 

If i put this validation don't run :\

field
property=name
depends=validwhen
arg0 key=icytReviForm.name.displayname/
var
var-nametest/var-name
var-value(act == 'alta')/var-value
/var 
/field

field
property=email
depends=validwhen,email
arg0 key=icytReviForm.name.displayname/
msg name=email key=errors.icytReviForm.formatoCOZ/
var
var-nametest/var-name
var-value(act == 'alta')/var-value
/var 
/field

Some one knows how to validate correctly?? Someone use validwhen and it's validate 
correctly?

Thanks in advance

Re: validwhen kills me!

2003-10-28 Thread Ruben Orta Magan
Sorry I've got and error...change

this line

var-value(act == 'alta')/var-value

with this

var-value(act == 'insert')/var-value

Thanks

- Original Message - 
From: Ruben Orta Magan [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Tuesday, October 28, 2003 2:02 PM
Subject: validwhen kills me!


Hello.I've got a problem with validwhen. I've got a form with two
buttons.one makes and insert in the database, and the other makes a
searchI want to make a validation only when the insert button is pushed
and i don't know if i understand correctly how validwhen works.

I've got this form

html:form action=/icytReviAction onsubmit=return
validateIcytReviForm(this)

html:text property=name/
html:text property=email/

html:hidden property=act/

html:submit value=alta
onclick=javascript:document.forms[0].act.value='insert';/
html:submit value=alta
onclick=javascript:document.forms[0].act.value='search';/

/html:form
The hidden input called act that is filled with the word search or
insert, the value depends of the button you push.

I want to set name as a required field and email has a required, email mask
field.

If i put this validation don't run :\

field
property=name
depends=validwhen
arg0 key=icytReviForm.name.displayname/
var
var-nametest/var-name
var-value(act == 'alta')/var-value
/var
/field

field
property=email
depends=validwhen,email
arg0 key=icytReviForm.name.displayname/
msg name=email key=errors.icytReviForm.formatoCOZ/
var
var-nametest/var-name
var-value(act == 'alta')/var-value
/var
/field

Some one knows how to validate correctly?? Someone use validwhen and it's
validate correctly?

Thanks in advance


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



Re: Indexed Properties + Validator + JavaScript

2003-10-28 Thread Nicholas L Mohler





Hi Vara,

I have implemented client-side validations for indexed properties, but I
have done it through custom validators.  Look through the archive for a
thread titled Validation of Indexed properties.  I describe how I
implemented the client side validations for indexed properties.

Nick




   

  Vara Prasad 

  Reddy   To:   Struts Users Mailing List 
[EMAIL PROTECTED]  
  [EMAIL PROTECTED]cc:
 
  bs.net  Subject:  Indexed Properties + 
Validator + JavaScript   
   

  10/28/2003 07:47 

  AM   

  Please respond to

  Struts Users

  Mailing List

   

   





The validations for indexed properties are not fired on the client side,
they are fired on the server side only.

Is there a way I can do that on the client side.

I am working on a PO screen with many line items.

Regards
Vara Prasad


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






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



RE: Struts-config

2003-10-28 Thread Kris Schneider
Or, if you're using Ant, try the optional xmlvalidate task (this is almost
exactly one of the examples given):

xmlvalidate file=struts-config.xml
  dtd publicId=-//Apache Software Foundation//DTD Struts Configuration 1.1//EN
   location=struts-config_1_1.dtd/
/xmlvalidate

http://ant.apache.org/manual/OptionalTasks/xmlvalidate.html

Quoting Matt Raible [EMAIL PROTECTED]:

 Download XML Spy (or another good XML tool) and validate it against the
 DTD.
 
 -Original Message-
 From: Edgar P Dollin [mailto:[EMAIL PROTECTED]
 Sent: Monday, October 27, 2003 4:37 PM
 To: Struts Users Mailing List
 Subject: Struts-config
 
 
 Has anyone experienced situtation where struts 1.1 will not allow any
 configuration items (controller / message-resources / plug-in) after the
 end
 of the action-mappings section.
 
 The error message is
 
   xml.sax.SAXParseException: Element struts-config allows no further
 input; controller is not allowed.
 
 I have checked the DTD and the position for these elements should follow
 action-mappings yet something is upsetting the digester.  I have double
 checked the syntax and made sure it is correct.
 
 If anyone has an insight, thanks in advance
 
 Edgar

-- 
Kris Schneider mailto:[EMAIL PROTECTED]
D.O.Tech   http://www.dotech.com/

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



RE: Indexed Properties + Validator + JavaScript

2003-10-28 Thread Vara Prasad Reddy
Nick

http://www.mail-archive.com/[EMAIL PROTECTED]/msg19122.html

is this the message you are talking about or something else ?


Vara Prasad

-Original Message-
From: Nicholas L Mohler [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 28, 2003 6:38 PM
To: Struts Users Mailing List
Subject: Re: Indexed Properties + Validator + JavaScript







Hi Vara,

I have implemented client-side validations for indexed properties, but I
have done it through custom validators.  Look through the archive for a
thread titled Validation of Indexed properties.  I describe how I
implemented the client side validations for indexed properties.

Nick





  Vara Prasad
  Reddy   To:   Struts Users
Mailing List [EMAIL PROTECTED]
  [EMAIL PROTECTED]cc:
  bs.net  Subject:  Indexed Properties
+ Validator + JavaScript

  10/28/2003 07:47
  AM
  Please respond to
  Struts Users
  Mailing List






The validations for indexed properties are not fired on the client side,
they are fired on the server side only.

Is there a way I can do that on the client side.

I am working on a PO screen with many line items.

Regards
Vara Prasad


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






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


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



Database Tomcat/Struts

2003-10-28 Thread Mathieu Grimault
For those who are in the same newbies problems like me, i found an answer here :

http://www.jguru.com/forums/view.jsp?EID=1120573

I was having Cannot load JDBC Drivers 'null'   when i was getting a connection on my 
database (getConnection()).

Thx all.

Re: newbie session problem

2003-10-28 Thread Geeta Ramani
Geraldine: Cookies and urlRewriting have been discussed a lot in the past.
You may want to search the archives..

regards,
Geeta

geraldine wrote:

 Thanks! The forward works great but the problem with the session still
 exists. My page only works when I enable cookies. However, I'm still
 looking for other solutions using url rewriting which somehow doesn't
 work! Can anyone else enlighten me or is my question just too trivial?
 Regards,
 Geraldine

 -Original Message-
 From: Geeta Ramani [mailto:[EMAIL PROTECTED]
 Sent: Monday, October 27, 2003 9:35 PM
 To: Struts Users Mailing List
 Subject: Re: newbie session problem

 Hi!  this doesn't explain why a new session is created, but in the link
 in your original jsp do not link directly to the second jsp: it's a bad
 practice anyway since it breaks MVC.  Instead use something like this:

 html:link page=/goToJsp2.doJsp 2/html:link

 In your struts-config.xml, add this action mapping:

 action path=/goToJsp2
 parameter=path_to_jsp2
 type=org.apache.struts.actions.ForwardAction /

 My guess is you should be alright then.. (Read up on
 org.apache.struts.actions.ForwardAction in the docs if necessary..)

 hth,
 Geeta

 [EMAIL PROTECTED] wrote:

  My struts application has a link to another jsp. but everytime i click
 on this link, the jsp creates a new session.
 
  I've tried practically everything, html:link,
 %response.encodeURL()% and even manually appending the jsessionid to
 the end of the url to this jsp, but it just keeps on creating those new
 sessions. Is there something i'm missing out? the funny thing is that
 the rest of my links work fine (just this fiddly one) and the even cuter
 thing is that sometimes it works and sometimes it doesn't! i'm trying
 not to use cookies to store my session. am i missing something out here?
 
  thanks
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]

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

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


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



RE: Indexed Properties + Validator + JavaScript

2003-10-28 Thread Nicholas L Mohler





Vara,

Sorry about that Vara.  I thought I had sent this via the mailing list.
This was based on a private exchange with another person.  I have pasted my
comments below.  I don't guarantee that my method is the best way, but it
works for me :-)

Let me know if this helps.
Nick

I have done some indexed property validation, but I have primarily done
this by creating custom validators.  Many of my custom validators provide
the same functionality, but I do customize it so that I can do what I need.

For example, I have a required validation that uses the same(cloned)
javascript code for client-side validation and for server-side validation,
my java code uses the struts code to carry out the validation.

My validations have a few variables that help my javascript or java class -
some may be unneccessary , but I'm not yet slick enough with the DOM to get
around them:
indexed - is the property indexed (allows me to reuse the
validation for non-indexed properties)
tableName   - name of the html table that contains the rows to be
validated
headerRowPresent  - helps me count data rows in the table.
listName- name of one row in the form property - used when the page
is submitted and the indexed properties are loaded into the form.
formCollectionName  - name of the form property that contains the
collection to be validated - I could probably combine with tableName

In the Javascript:
I get my indexed variable and if the property is indexed, I set up to loop
through my table rows.
  I get the html table and get the row count so that I know how many
data rows to validate.
  I then loop through each row:
Construct the element name using the listName value + [ +
indexId + ]. + propertyName
Get the form element for the name and pass it to the validation
function to apply the validation.
If the property is not indexed, I get the form element and pass it to the
validation function to apply the validation.

I add any validation failure messsages to the fields array in the same
way as the struts validations, but I tack on the row number for information
since I validate all of the data rows.

In my java validation class, I do similar things, but I only apply the
indexed validations until one fails.  My java validation uses reflection in
quite a few places to invoke struts validations and to apply my own
validations.  The overall process is easier, though.
1)  Determine if the property is indexed.  If it is, then loop through the
collection of objects (formCollectionName) that contain the property.
2)  For each collection element, invoke the appropriate validation method
until all of the rows are validated or a property fails validation.
3)  If the property is not indexed, invoke the appropriate validation
method for the property.





   

  Vara Prasad 

  Reddy   To:   Struts Users Mailing List 
[EMAIL PROTECTED]  
  [EMAIL PROTECTED]cc:
 
  bs.net  Subject:  RE: Indexed Properties + 
Validator + JavaScript   
   

  10/28/2003 08:30 

  AM   

  Please respond to

  Struts Users

  Mailing List

   

   





Nick

http://www.mail-archive.com/[EMAIL PROTECTED]/msg19122.html

is this the message you are talking about or something else ?


Vara Prasad

-Original Message-
From: Nicholas L Mohler [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 28, 2003 6:38 PM
To: Struts Users Mailing List
Subject: Re: Indexed Properties + Validator + JavaScript







Hi Vara,

I have implemented client-side 

Re: RE: Frames and IFrames in Struts

2003-10-28 Thread George Steimer
Thanks for your response.  So, given that I can't simply persist the form bean -- is 
there a way that I can pass the information to each frame?  We can't use a session 
bean because we need to have the ability to have multiple framesets up at the same 
time -- each with different information in the form bean. 

Thanks again,

George

 snip
 when the framed pages load, they do not have access to the form bean.
 /snip
 
 The issue here is that for each frame the browser will send a seperate
 independent request to the server - its NOT the same request!
 
 You will therefore need to consider other ways of providing the frames with
 the information they need. Maybe use a session scoped form and forward
 through an action such that each frames jsp ends up with the same instance?
 (be aware that each frame is also processed by its own thread serverside so
 you may need to consider synchronization issues and suchlike).
 
 btw: Depending what it is you are doing maybe frames arent really what you
 want? For example if your just using them to get a 'templating' effect you
 might be better off using single pages and doing that templating using
 Tiles?
 
 
 -Original Message-
 From: George Steimer [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, 28 October 2003 06:00
 To: [EMAIL PROTECTED]
 Subject: Frames and IFrames in Stuts
 
 
 Hi,
 
 I am a relative newbie with struts and I am trying to utilize both frames
 and IFrames from within a struts web application.   The application we are
 building has a form that submits to a jsp page that conatains a frameset.  I
 am using the html:frame tag in the frameset, but when the framed pages load,
 they do not have access to the form bean.  For the forward attribute of the
 frame, I have tried using both an action and a global forward, but neither
 works.  Am I missing something?  All I need to to is get the framed pages to
 read from the form bean that was submitted to the frameset jsp.
 
 Here is the source of the frameset JSP (excluding taglib declarations):
 
 frameset name=testFrameset cols=50%,*
 html:frame frameName=frameLeft forward=testFrameLeft /
 html:frame frameName=frameRight forward=testFrameRight /
 /frameset
 
 Here is the global forwards section of the struts-config.xml:
 global-forwards
 forward name=testFrameLeft path=/testFrameLeft.jsp /
 forward name=testFrameRight path=/testFrameRight.jsp /
 /global-forwards
 
 Also, the application we are building also utilizes iframes.  I've searched
 the javadocs and a couple books, but I can't find a similar mechanism with
 struts.  Is there a way to get request scoped parameters into the source of
 an Iframe?
 
 Any help is greatly appreciated!
 
 Thanks,
 
 George
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


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



RE: please help: ActionForms of same type but different name?

2003-10-28 Thread Chen, Gin
The problem here is that with 5 login forms.. How would you know or even
care which of the 5 was used to submit?
Is it processed differently if I pick m of n versus x of n?
In any case sounds like what you really want is the same form and the same
action.
Ie..

I might have a bean such that it only contains one parameter.
(don't mind syntax as stupid outlook keeps trying to apply spelling and
grammer rules which I don't want to turn off cause I'm the worst
speller/grammulator)

form-bean name=loginForm
type=org.apache.struts.validator.DynaValidatorForm
form-property name=formIteration
type=java.lang.Integer/
/form-bean

This bean is mapped to the same action. (ex. /loginAction)

Then for my JSP :
//remember n is simulated ie. don't put n in end (duh) :)
c:forEach var=loopCnt begin=1 end=n
 html:form action=/loginAction
  html-el:hidden property=formIteration
value=${loopCnt}/
  html:submit property=userAction
 bean:message key=button.login/
  /html:submit
 /html:form
/c:forEach

Now your action is pretty simple.
Based on the formIteration value you know which of the n forms was used to
login.
Hope that helps.
-Tim

-Original Message-
From: Sonam Belbase [mailto:[EMAIL PROTECTED] 
Sent: Monday, October 27, 2003 6:37 PM
To: Struts Users Mailing List
Subject: Re: please help: ActionForms of same type but different name?


There is no knowing until runtime how many iterations there are going to be.
That's why we can't define the n number of LoginForms.

The requirement is that on the same jsp, we will have repeating
html:form/html:form sections. User will specify at runtime
how many he/she wants. The html:forms will all be of the same
type. Restriction is that only one can be submitted at a time, i.e. user
might have specified 5 Login sections of the page, and therefore is shown 5
login sections,  but can only save one at a time.

The save action needs to know which form to retrieve the values
username and password from.

SB

Chen, Gin wrote:

 One approach, you can define as many form-beans as you want iteratations.
 Ex:
 form-bean name=LoginForm_1
   type=com.oreilly.struts.storefront.security.LoginForm
 /form-bean
 form-bean name=LoginForm_2
   type=com.oreilly.struts.storefront.security.LoginForm
 /form-bean
 .
 .
 .
 form-bean name=LoginForm_n
   type=com.oreilly.struts.storefront.security.LoginForm
 /form-bean

 You can also just use a single form bean for all your actions.. If they
are
 the same class then they are the same formbean anyways.
 So just use the same name for all of them (well not html:form name in
Struts
 1.1+ but rather use name in action definition).
 Or If you explain your requirements a bit more we could come up with a
 better solution/explanation.
 -Tim

 -Original Message-
 From: Sonam Belbase [mailto:[EMAIL PROTECTED]
 Sent: Monday, October 27, 2003 6:16 PM
 To: Struts Users Mailing List
 Subject: please help: ActionForms of same type but different name?

 Given the following code in my jsp:

 logic:iterate id=element name=dynamicFormList
 type=java.lang.String 
 html:form  action=/login name=%=element%
 type=com.oreilly.struts.storefront.security.LoginForm

   User Name:
   html:text property=userName size=20 maxlength=50/
   Password:
   html:text property=password size=20 maxlength=50/
   html:hidden property=identifier value=%= element % /
   html:submit property= value=OK /

 /html:form
 /logic:iterate

 element has the value LoginForm_1 in the first iteratation,
 LoginForm_2 in the second iteration, and so on.

 In struts-config:
 form-bean name=LoginForm
   type=com.oreilly.struts.storefront.security.LoginForm
 /form-bean

 LoginForm extends ActionForm.

 I understand that the attributes name and type have been deprecated
 but I am trying to get the iteration to create and display a new
 instance of the LoginForm, each with it's own name and properties. After
 submit, the request processor seems to look for a formbean associated
 with the action (in this case, a formbean called LoginForm) and not a
 formbean with name LoginForm_1 and therefore in the action the form
 property values are all null.

 Anyone know how I can get it to look for the formBean with the unique
 name that was specified by the variable element?

 Thanks,
 SB

 --
 NOTICE: If received in error, please destroy and notify sender.  Sender
 does not waive confidentiality or privilege, and use is prohibited.

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

--
NOTICE: If received in error, please destroy and notify sender.  Sender does
not
waive confidentiality or privilege, and use is prohibited.



-
To unsubscribe, e-mail: [EMAIL 

Re: Antwort: [OT] Re: far reaching db question

2003-10-28 Thread David Graham

--- Manuel Lenz [EMAIL PROTECTED] wrote:
 How do preparedStatements handle single quotes and other injection 
 attacks?

This is JDBC driver dependent.  Each database might handle single quote
escaping differently; however, doubling them with another single quote
seems to be common.

 I changed my db-connection from a normal statement-conding into prepared
 
 statements.
 But the error ist still the same.
 
 Here ist my test-coding:
 Connection conn = null;
 PreparedStatement prepare = null;
 ServletContext context = as.getServletContext();
 boolean ret = false;
  
 try
 {
 DataSource ds = (DataSource) 
 context.getAttribute(Action.DATA_SOURCE_KEY);
  
 // Update Banf-Daten
 String sql = update tab_article set ...  
 System.out.println (sql);
  
 conn = ds.getConnection();
 prepare = conn.prepareStatement(sql);
 prepare.executeQuery(sql);
 }
 catch (Exception ex)

You should be catching SQLException here.  Catching Exception is almost
*always* wrong.  You should also have a finally block that closes the
connection.

 
 
 Do I need some extra coding for injection attacks, or is this coding 
 wrong?

No, the driver should handle this for you.  You can test it by stringing
together two SQL statements with a ; in between and see if both get
executed.  If the driver is doing its job, you'll get an SQLException.

David

 
 Regards,
 Manuel
 
 
 
 
 
 
 David Graham [EMAIL PROTECTED]
 24.10.2003 17:47
 Bitte antworten an Struts Users Mailing List
  
 An: Struts Users Mailing List
 [EMAIL PROTECTED]
 Kopie: 
 Thema:  [OT] Re: far reaching db question
 
 
  I create DB-Inserts from my struts application.
  But If an user types in the sign ' any dynamicly created inserts fail.
  This ist because of the sql-syntax which divides the string which will
  be
  saved with '.
  
  For example: insert into table test (name, number) values ('mr burns',
  '01723256477');
  
  How can I handle inserts in html-formulars which have the typed sign '
 ?
  
 
 Always use PreparedStatements.  They handle the ' for you and prevent
 other SQL injection attacks.
 
 David
 
  Greetings,
  Manuel
  
  
  
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  
 
 
 __
 Do you Yahoo!?
 The New Yahoo! Shopping - with improved product search
 http://shopping.yahoo.com
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


__
Do you Yahoo!?
Exclusive Video Premiere - Britney Spears
http://launch.yahoo.com/promos/britneyspears/

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



Problem with UTF-8 characters in a mutlipart/form-data encoded form

2003-10-28 Thread Paul Barry
I am using Struts 1.1 in an application that needs to support the UTF-8 character set.  I am using Resin 2.1.10 with 
character-encoding=UTF-8, and on most of my forms this seems to work just fine.  I am having problems with forms that 
have to use the multipart/form-data enctype for handling uploading files.  If I print out the value of a text element in 
an html:form where the enctype is not set at all (which ends up using application/x-www-form-urlencoded), using UTF-8 
characters works fine.  This is what I get:

INFO - test.TestAction - The value is: ä

Here is what the actual HTTP request that gets sent to the server looks like:

--- Start HTTP Request -
POST /testForm.do HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, 
application/x-shockwave-flash, */*
Referer: http://pbdesktop/test.do
Accept-Language: en-us
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
Host: pbdesktop
Content-Length: 11
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: SERVER=op; locale=en_US; JSESSIONID=aoUCARQpqsLd
test=%C3%AD
--- End HTTP Request --
But if I modify my html:form to use enctype=multipart/form-data, I get this:

INFO - test.TestAction - The value is: A¤

And the HTTP request looks like this:

--- Start HTTP Request -
POST /testForm.do HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, 
application/x-shockwave-flash, */*
Referer: http://pbdesktop/test.do
Accept-Language: en-us
Content-Type: multipart/form-data; boundary=---7d319628600e4
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
Host: pbdesktop
Content-Length: 141
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: SERVER=op; locale=en_US; JSESSIONID=aoUCARQpqsLd
-7d319628600e4
Content-Disposition: form-data; name=test
í
-7d319628600e4-
--- End HTTP Request --
It looks as if the character is already messed up before it even gets to the servlet container.  There are messages in 
the mailing list archive that discuss this problem, but I didn't see a solution.  What is the best way to handle UTF-8 
characters in a multipart/form-data encoded form?

Here is the code that I am testing with:

/test/test.jsp:
%@ taglib uri=WEB-INF/taglib/struts-html.tld prefix=html %
%@ taglib uri=WEB-INF/taglib/struts-bean.tld prefix=bean %
html:html
  body
html:form action=testForm.do enctype=multipart/form-data
  html:text property=test /
  html:submit /
/html:form
  /body
/html:html
Relavent parts of struts-config.xml:
struts-config
  form-beans
form-bean name=testForm type=test.TestActionForm /
  /form-beans
  action-mappings
action path=/test type=org.apache.struts.actions.ForwardAction 
parameter=/test/test.jsp /
action path=/testForm type=test.TestAction name=testForm input=/test.do 
scope=request /
  /action-mappings
  controller contentType=text/html;charset=UTF-8 /

struts-config/

test.TestAction:
package test;
import javax.servlet.http.*;
import org.apache.commons.logging.*;
import org.apache.struts.action.*;
public class TestAction extends Action {
private static final Log log = LogFactory.getLog(TestAction.class);

public ActionForward execute(
ActionMapping mapping,
ActionForm pform,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
TestActionForm form = (TestActionForm)pform;
log.info(The value is: +form.getTest());
return null;
}
}
test.TestActionForm:
package test;
import org.apache.struts.action.ActionForm;

public class TestActionForm extends ActionForm {
private String test;
public String getTest() { return test;  }
public void setTest(String string) { test = string; }
}
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Problem with UTF-8 characters in a mutlipart/form-data encoded form

2003-10-28 Thread José Gustavo Zagato
Hi !

I don't if it will fit into your needs but, to handler UTF-8 I
build a serverlet filter with handles all encode / Decode operations. As
far as I know this approach is not a pure Struts solution but works
really fine !
I didn't test with a upload form like yours, but it’s a shot !

Regards

  José Gustavo Zagato Rosa
System Analyst - Atos Origin
[EMAIL PROTECTED]


-Original Message-
From: Paul Barry [mailto:[EMAIL PROTECTED] 
Sent: terça-feira, 28 de outubro de 2003 12:07
To: [EMAIL PROTECTED]
Subject: Problem with UTF-8 characters in a mutlipart/form-data encoded
form

I am using Struts 1.1 in an application that needs to support the UTF-8
character set.  I am using Resin 2.1.10 with 
character-encoding=UTF-8, and on most of my forms this seems to work
just fine.  I am having problems with forms that 
have to use the multipart/form-data enctype for handling uploading
files.  If I print out the value of a text element in 
an html:form where the enctype is not set at all (which ends up using
application/x-www-form-urlencoded), using UTF-8 
characters works fine.  This is what I get:

INFO - test.TestAction - The value is: ä

Here is what the actual HTTP request that gets sent to the server looks
like:

--- Start HTTP Request
-
POST /testForm.do HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
application/x-shockwave-flash, */*
Referer: http://pbdesktop/test.do
Accept-Language: en-us
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
Host: pbdesktop
Content-Length: 11
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: SERVER=op; locale=en_US; JSESSIONID=aoUCARQpqsLd

test=%C3%AD
--- End HTTP Request
--

But if I modify my html:form to use enctype=multipart/form-data, I get
this:

INFO - test.TestAction - The value is: A¤

And the HTTP request looks like this:

--- Start HTTP Request
-
POST /testForm.do HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
application/x-shockwave-flash, */*
Referer: http://pbdesktop/test.do
Accept-Language: en-us
Content-Type: multipart/form-data;
boundary=---7d319628600e4
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
Host: pbdesktop
Content-Length: 141
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: SERVER=op; locale=en_US; JSESSIONID=aoUCARQpqsLd

-7d319628600e4
Content-Disposition: form-data; name=test

í
-7d319628600e4-
--- End HTTP Request
--

It looks as if the character is already messed up before it even gets to
the servlet container.  There are messages in 
the mailing list archive that discuss this problem, but I didn't see a
solution.  What is the best way to handle UTF-8 
characters in a multipart/form-data encoded form?

Here is the code that I am testing with:

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

html:html
   body
 html:form action=testForm.do enctype=multipart/form-data
   html:text property=test /
   html:submit /
 /html:form
   /body
/html:html

Relavent parts of struts-config.xml:
struts-config

   form-beans
 form-bean name=testForm type=test.TestActionForm /
   /form-beans

   action-mappings
 action path=/test type=org.apache.struts.actions.ForwardAction
parameter=/test/test.jsp /
 action path=/testForm type=test.TestAction name=testForm
input=/test.do scope=request /
   /action-mappings

   controller contentType=text/html;charset=UTF-8 /

struts-config/

test.TestAction:
package test;

import javax.servlet.http.*;
import org.apache.commons.logging.*;
import org.apache.struts.action.*;

public class TestAction extends Action {
private static final Log log =
LogFactory.getLog(TestAction.class);

public ActionForward execute(
ActionMapping mapping,
ActionForm pform,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
TestActionForm form = (TestActionForm)pform;
log.info(The value is: +form.getTest());
return null;
}
}

test.TestActionForm:
package test;

import org.apache.struts.action.ActionForm;

public class TestActionForm extends ActionForm {
private String test;
public String getTest() { return test;  }
public void setTest(String string) { test = string; }
}


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

wildcard matching support

2003-10-28 Thread Sonam Belbase
Hi,

I am looking to use Wildcard matching support for my action mappings.
I am currently using Struts 1.1 .
This feature does not seem to be supported in the build I have .

If any one has used the WildCardMatching support in struts ,I would like

to know the release build to use to pick up these classes.

Any information would be extremely useful.

Thanks.

SB

--
NOTICE: If received in error, please destroy and notify sender.  Sender
does not waive confidentiality or privilege, and use is prohibited.



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



Re: Problem with UTF-8 characters in a mutlipart/form-data encoded form

2003-10-28 Thread Paul Barry
Does it work with multipart/form-data encoding?  It seems to me that this problem is happening before the form is 
submitted to the servlet container (take a look at the value of test in the HTTP request with Content-Type: 
multipart/form-data in my original post), so the servlet filter wouldn't help, but I could be wrong.

Jos Gustavo Zagato wrote:

Hi !

I don't if it will fit into your needs but, to handler UTF-8 I
build a serverlet filter with handles all encode / Decode operations. As
far as I know this approach is not a pure Struts solution but works
really fine !
I didn't test with a upload form like yours, but its a shot !
Regards

  Jos Gustavo Zagato Rosa
System Analyst - Atos Origin
[EMAIL PROTECTED]
-Original Message-
From: Paul Barry [mailto:[EMAIL PROTECTED] 
Sent: tera-feira, 28 de outubro de 2003 12:07
To: [EMAIL PROTECTED]
Subject: Problem with UTF-8 characters in a mutlipart/form-data encoded
form

I am using Struts 1.1 in an application that needs to support the UTF-8
character set.  I am using Resin 2.1.10 with 
character-encoding=UTF-8, and on most of my forms this seems to work
just fine.  I am having problems with forms that 
have to use the multipart/form-data enctype for handling uploading
files.  If I print out the value of a text element in 
an html:form where the enctype is not set at all (which ends up using
application/x-www-form-urlencoded), using UTF-8 
characters works fine.  This is what I get:

INFO - test.TestAction - The value is: 

Here is what the actual HTTP request that gets sent to the server looks
like:
--- Start HTTP Request
-
POST /testForm.do HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
application/x-shockwave-flash, */*
Referer: http://pbdesktop/test.do
Accept-Language: en-us
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
Host: pbdesktop
Content-Length: 11
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: SERVER=op; locale=en_US; JSESSIONID=aoUCARQpqsLd
test=%C3%AD
--- End HTTP Request
--
But if I modify my html:form to use enctype=multipart/form-data, I get
this:
INFO - test.TestAction - The value is: A

And the HTTP request looks like this:

--- Start HTTP Request
-
POST /testForm.do HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
application/x-shockwave-flash, */*
Referer: http://pbdesktop/test.do
Accept-Language: en-us
Content-Type: multipart/form-data;
boundary=---7d319628600e4
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
Host: pbdesktop
Content-Length: 141
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: SERVER=op; locale=en_US; JSESSIONID=aoUCARQpqsLd
-7d319628600e4
Content-Disposition: form-data; name=test

-7d319628600e4-
--- End HTTP Request
--
It looks as if the character is already messed up before it even gets to
the servlet container.  There are messages in 
the mailing list archive that discuss this problem, but I didn't see a
solution.  What is the best way to handle UTF-8 
characters in a multipart/form-data encoded form?

Here is the code that I am testing with:

/test/test.jsp:
%@ taglib uri=WEB-INF/taglib/struts-html.tld prefix=html %
%@ taglib uri=WEB-INF/taglib/struts-bean.tld prefix=bean %
html:html
   body
 html:form action=testForm.do enctype=multipart/form-data
   html:text property=test /
   html:submit /
 /html:form
   /body
/html:html
Relavent parts of struts-config.xml:
struts-config
   form-beans
 form-bean name=testForm type=test.TestActionForm /
   /form-beans
   action-mappings
 action path=/test type=org.apache.struts.actions.ForwardAction
parameter=/test/test.jsp /
 action path=/testForm type=test.TestAction name=testForm
input=/test.do scope=request /
   /action-mappings
   controller contentType=text/html;charset=UTF-8 /

struts-config/

test.TestAction:
package test;
import javax.servlet.http.*;
import org.apache.commons.logging.*;
import org.apache.struts.action.*;
public class TestAction extends Action {
private static final Log log =
LogFactory.getLog(TestAction.class);

public ActionForward execute(
ActionMapping mapping,
ActionForm pform,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
TestActionForm form = (TestActionForm)pform;
log.info(The value is: +form.getTest());
return null;
}
}
test.TestActionForm:
package test;
import org.apache.struts.action.ActionForm;


Struts cannot support relative uri ?

2003-10-28 Thread javen fang
Hi, all.  I am fajaven from matrix(www.matrix.org.cn)
in China.

I wonder it seems like Struts cannot support relative
uri.

In tomcat 5.0 , my webapp looks like:
tomcat/webapps/asales

Two files are:
tomcat/webapps/asales/pages/left.jsp
tomcat/webapps/asales/pages/images/logo.jpg

Normally, in left.jsp, I use logo.jpg, like this:
img src=images/logo.jpg/

but if in left.jsp include struts tags, or it mapping
from struts action, then relative uri will fail, and
absolute uri is required:
img src=/asales/pages/images/logo.jpg/

You know, relative uri cannot be used is not
convinient very much.

How can I solve this question? 

Thanks.

javen fang from matrix

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



RE: Problem with UTF-8 characters in a mutlipart/form-data encoded form

2003-10-28 Thread javen fang
It's true, although servlet filter is not pure struts
method, but it is used to solve character-encoding
widely in struts framework. 


--- Jos#38283;Gustavo_Zagato
[EMAIL PROTECTED] wrote:
 Hi !
 
   I don't if it will fit into your needs but, to
 handler UTF-8 I
 build a serverlet filter with handles all encode /
 Decode operations. As
 far as I know this approach is not a pure Struts
 solution but works
 really fine !
 I didn't test with a upload form like yours, but
 it#25263; a shot !
 
 Regards
 
   Jos?Gustavo Zagato Rosa
 System Analyst - Atos Origin
 [EMAIL PROTECTED]
 
 
 -Original Message-
 From: Paul Barry [mailto:[EMAIL PROTECTED] 
 Sent: ter#37872;-feira, 28 de outubro de 2003 12:07
 To: [EMAIL PROTECTED]
 Subject: Problem with UTF-8 characters in a
 mutlipart/form-data encoded
 form
 
 I am using Struts 1.1 in an application that needs
 to support the UTF-8
 character set.  I am using Resin 2.1.10 with 
 character-encoding=UTF-8, and on most of my forms
 this seems to work
 just fine.  I am having problems with forms that 
 have to use the multipart/form-data enctype for
 handling uploading
 files.  If I print out the value of a text element
 in 
 an html:form where the enctype is not set at all
 (which ends up using
 application/x-www-form-urlencoded), using UTF-8 
 characters works fine.  This is what I get:
 
 INFO - test.TestAction - The value is: ? 
 Here is what the actual HTTP request that gets sent
 to the server looks
 like:
 
 --- Start HTTP Request

-
 POST /testForm.do HTTP/1.1
 Accept: image/gif, image/x-xbitmap, image/jpeg,
 image/pjpeg,
 application/x-shockwave-flash, */*
 Referer: http://pbdesktop/test.do
 Accept-Language: en-us
 Content-Type: application/x-www-form-urlencoded
 Accept-Encoding: gzip, deflate
 User-Agent: Mozilla/4.0 (compatible; MSIE 6.0;
 Windows NT 5.0)
 Host: pbdesktop
 Content-Length: 11
 Connection: Keep-Alive
 Cache-Control: no-cache
 Cookie: SERVER=op; locale=en_US;
 JSESSIONID=aoUCARQpqsLd
 
 test=%C3%AD
 --- End HTTP Request

--
 
 But if I modify my html:form to use
 enctype=multipart/form-data, I get
 this:
 
 INFO - test.TestAction - The value is: A? 
 And the HTTP request looks like this:
 
 --- Start HTTP Request

-
 POST /testForm.do HTTP/1.1
 Accept: image/gif, image/x-xbitmap, image/jpeg,
 image/pjpeg,
 application/x-shockwave-flash, */*
 Referer: http://pbdesktop/test.do
 Accept-Language: en-us
 Content-Type: multipart/form-data;
 boundary=---7d319628600e4
 Accept-Encoding: gzip, deflate
 User-Agent: Mozilla/4.0 (compatible; MSIE 6.0;
 Windows NT 5.0)
 Host: pbdesktop
 Content-Length: 141
 Connection: Keep-Alive
 Cache-Control: no-cache
 Cookie: SERVER=op; locale=en_US;
 JSESSIONID=aoUCARQpqsLd
 
 -7d319628600e4
 Content-Disposition: form-data; name=test
 
 #38086;
 -7d319628600e4-
 --- End HTTP Request

--
 
 It looks as if the character is already messed up
 before it even gets to
 the servlet container.  There are messages in 
 the mailing list archive that discuss this problem,
 but I didn't see a
 solution.  What is the best way to handle UTF-8 
 characters in a multipart/form-data encoded form?
 
 Here is the code that I am testing with:
 
 /test/test.jsp:
 %@ taglib uri=WEB-INF/taglib/struts-html.tld
 prefix=html %
 %@ taglib uri=WEB-INF/taglib/struts-bean.tld
 prefix=bean %
 
 html:html
body
  html:form action=testForm.do
 enctype=multipart/form-data
html:text property=test /
html:submit /
  /html:form
/body
 /html:html
 
 Relavent parts of struts-config.xml:
 struts-config
 
form-beans
  form-bean name=testForm
 type=test.TestActionForm /
/form-beans
 
action-mappings
  action path=/test
 type=org.apache.struts.actions.ForwardAction
 parameter=/test/test.jsp /
  action path=/testForm type=test.TestAction
 name=testForm
 input=/test.do scope=request /
/action-mappings
 
controller contentType=text/html;charset=UTF-8
 /
 
 struts-config/
 
 test.TestAction:
 package test;
 
 import javax.servlet.http.*;
 import org.apache.commons.logging.*;
 import org.apache.struts.action.*;
 
 public class TestAction extends Action {
   private static final Log log =
 LogFactory.getLog(TestAction.class);
   
   public ActionForward execute(
   ActionMapping mapping,
   ActionForm pform,
   HttpServletRequest request,
   HttpServletResponse response)
   throws Exception {
   TestActionForm form = (TestActionForm)pform;
   log.info(The value is: +form.getTest());
   return null;
   }
 }
 
 test.TestActionForm:
 package test;
 
 import 

RE: Problem with UTF-8 characters in a mutlipart/form-data encoded form

2003-10-28 Thread José Gustavo Zagato
I have doubts on it also... 
The only thing that I'm doing at the front end is to set the encode to
utf-8 I will double check it..

Regards...

  José Gustavo Zagato Rosa
System Analyst - Atos Origin
[EMAIL PROTECTED]


-Original Message-
From: Paul Barry [mailto:[EMAIL PROTECTED] 
Sent: terça-feira, 28 de outubro de 2003 12:26
To: Struts Users Mailing List
Subject: Re: Problem with UTF-8 characters in a mutlipart/form-data
encoded form

Does it work with multipart/form-data encoding?  It seems to me that
this problem is happening before the form is 
submitted to the servlet container (take a look at the value of test
in the HTTP request with Content-Type: 
multipart/form-data in my original post), so the servlet filter wouldn't
help, but I could be wrong.

José Gustavo Zagato wrote:

 Hi !
 
   I don't if it will fit into your needs but, to handler UTF-8 I
 build a serverlet filter with handles all encode / Decode operations.
As
 far as I know this approach is not a pure Struts solution but works
 really fine !
 I didn't test with a upload form like yours, but it’s a shot !
 
 Regards
 
   José Gustavo Zagato Rosa
 System Analyst - Atos Origin
 [EMAIL PROTECTED]
 
 
 -Original Message-
 From: Paul Barry [mailto:[EMAIL PROTECTED] 
 Sent: terça-feira, 28 de outubro de 2003 12:07
 To: [EMAIL PROTECTED]
 Subject: Problem with UTF-8 characters in a mutlipart/form-data
encoded
 form
 
 I am using Struts 1.1 in an application that needs to support the
UTF-8
 character set.  I am using Resin 2.1.10 with 
 character-encoding=UTF-8, and on most of my forms this seems to work
 just fine.  I am having problems with forms that 
 have to use the multipart/form-data enctype for handling uploading
 files.  If I print out the value of a text element in 
 an html:form where the enctype is not set at all (which ends up using
 application/x-www-form-urlencoded), using UTF-8 
 characters works fine.  This is what I get:
 
 INFO - test.TestAction - The value is: ä
 
 Here is what the actual HTTP request that gets sent to the server
looks
 like:
 
 --- Start HTTP Request
 -
 POST /testForm.do HTTP/1.1
 Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
 application/x-shockwave-flash, */*
 Referer: http://pbdesktop/test.do
 Accept-Language: en-us
 Content-Type: application/x-www-form-urlencoded
 Accept-Encoding: gzip, deflate
 User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
 Host: pbdesktop
 Content-Length: 11
 Connection: Keep-Alive
 Cache-Control: no-cache
 Cookie: SERVER=op; locale=en_US; JSESSIONID=aoUCARQpqsLd
 
 test=%C3%AD
 --- End HTTP Request
 --
 
 But if I modify my html:form to use enctype=multipart/form-data, I
get
 this:
 
 INFO - test.TestAction - The value is: A¤
 
 And the HTTP request looks like this:
 
 --- Start HTTP Request
 -
 POST /testForm.do HTTP/1.1
 Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
 application/x-shockwave-flash, */*
 Referer: http://pbdesktop/test.do
 Accept-Language: en-us
 Content-Type: multipart/form-data;
 boundary=---7d319628600e4
 Accept-Encoding: gzip, deflate
 User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
 Host: pbdesktop
 Content-Length: 141
 Connection: Keep-Alive
 Cache-Control: no-cache
 Cookie: SERVER=op; locale=en_US; JSESSIONID=aoUCARQpqsLd
 
 -7d319628600e4
 Content-Disposition: form-data; name=test
 
 í
 -7d319628600e4-
 --- End HTTP Request
 --
 
 It looks as if the character is already messed up before it even gets
to
 the servlet container.  There are messages in 
 the mailing list archive that discuss this problem, but I didn't see a
 solution.  What is the best way to handle UTF-8 
 characters in a multipart/form-data encoded form?
 
 Here is the code that I am testing with:
 
 /test/test.jsp:
 %@ taglib uri=WEB-INF/taglib/struts-html.tld prefix=html %
 %@ taglib uri=WEB-INF/taglib/struts-bean.tld prefix=bean %
 
 html:html
body
  html:form action=testForm.do enctype=multipart/form-data
html:text property=test /
html:submit /
  /html:form
/body
 /html:html
 
 Relavent parts of struts-config.xml:
 struts-config
 
form-beans
  form-bean name=testForm type=test.TestActionForm /
/form-beans
 
action-mappings
  action path=/test
type=org.apache.struts.actions.ForwardAction
 parameter=/test/test.jsp /
  action path=/testForm type=test.TestAction name=testForm
 input=/test.do scope=request /
/action-mappings
 
controller contentType=text/html;charset=UTF-8 /
 
 struts-config/
 
 test.TestAction:
 package test;
 
 import javax.servlet.http.*;
 import org.apache.commons.logging.*;
 import org.apache.struts.action.*;
 
 public class TestAction extends 

Re: please help: ActionForms of same type but different name?

2003-10-28 Thread Sonam Belbase
Tim,

We do have the same form and the same action and more
specifically, we have the LoginFormTypeA processed by loginActionA
and LoginFormTypeB processed by loginActionB. Of the
5 login forms, three could be of type A, 2 could be of type B.





Chen, Gin wrote:

 The problem here is that with 5 login forms.. How would you know or even
 care which of the 5 was used to submit?
 Is it processed differently if I pick m of n versus x of n?
 In any case sounds like what you really want is the same form and the same
 action.
 Ie..

 I might have a bean such that it only contains one parameter.
 (don't mind syntax as stupid outlook keeps trying to apply spelling and
 grammer rules which I don't want to turn off cause I'm the worst
 speller/grammulator)

 form-bean name=loginForm
 type=org.apache.struts.validator.DynaValidatorForm
 form-property name=formIteration
 type=java.lang.Integer/
 /form-bean

 This bean is mapped to the same action. (ex. /loginAction)

 Then for my JSP :
 //remember n is simulated ie. don't put n in end (duh) :)
 c:forEach var=loopCnt begin=1 end=n
  html:form action=/loginAction
   html-el:hidden property=formIteration
 value=${loopCnt}/
   html:submit property=userAction
  bean:message key=button.login/
   /html:submit
  /html:form
 /c:forEach

 Now your action is pretty simple.
 Based on the formIteration value you know which of the n forms was used to
 login.
 Hope that helps.
 -Tim

 -Original Message-
 From: Sonam Belbase [mailto:[EMAIL PROTECTED]
 Sent: Monday, October 27, 2003 6:37 PM
 To: Struts Users Mailing List
 Subject: Re: please help: ActionForms of same type but different name?

 There is no knowing until runtime how many iterations there are going to be.
 That's why we can't define the n number of LoginForms.

 The requirement is that on the same jsp, we will have repeating
 html:form/html:form sections. User will specify at runtime
 how many he/she wants. The html:forms will all be of the same
 type. Restriction is that only one can be submitted at a time, i.e. user
 might have specified 5 Login sections of the page, and therefore is shown 5
 login sections,  but can only save one at a time.

 The save action needs to know which form to retrieve the values
 username and password from.

 SB

 Chen, Gin wrote:

  One approach, you can define as many form-beans as you want iteratations.
  Ex:
  form-bean name=LoginForm_1
type=com.oreilly.struts.storefront.security.LoginForm
  /form-bean
  form-bean name=LoginForm_2
type=com.oreilly.struts.storefront.security.LoginForm
  /form-bean
  .
  .
  .
  form-bean name=LoginForm_n
type=com.oreilly.struts.storefront.security.LoginForm
  /form-bean
 
  You can also just use a single form bean for all your actions.. If they
 are
  the same class then they are the same formbean anyways.
  So just use the same name for all of them (well not html:form name in
 Struts
  1.1+ but rather use name in action definition).
  Or If you explain your requirements a bit more we could come up with a
  better solution/explanation.
  -Tim
 
  -Original Message-
  From: Sonam Belbase [mailto:[EMAIL PROTECTED]
  Sent: Monday, October 27, 2003 6:16 PM
  To: Struts Users Mailing List
  Subject: please help: ActionForms of same type but different name?
 
  Given the following code in my jsp:
 
  logic:iterate id=element name=dynamicFormList
  type=java.lang.String 
  html:form  action=/login name=%=element%
  type=com.oreilly.struts.storefront.security.LoginForm
 
User Name:
html:text property=userName size=20 maxlength=50/
Password:
html:text property=password size=20 maxlength=50/
html:hidden property=identifier value=%= element % /
html:submit property= value=OK /
 
  /html:form
  /logic:iterate
 
  element has the value LoginForm_1 in the first iteratation,
  LoginForm_2 in the second iteration, and so on.
 
  In struts-config:
  form-bean name=LoginForm
type=com.oreilly.struts.storefront.security.LoginForm
  /form-bean
 
  LoginForm extends ActionForm.
 
  I understand that the attributes name and type have been deprecated
  but I am trying to get the iteration to create and display a new
  instance of the LoginForm, each with it's own name and properties. After
  submit, the request processor seems to look for a formbean associated
  with the action (in this case, a formbean called LoginForm) and not a
  formbean with name LoginForm_1 and therefore in the action the form
  property values are all null.
 
  Anyone know how I can get it to look for the formBean with the unique
  name that was specified by the variable element?
 
  Thanks,
  SB
 
  --
  NOTICE: If received in error, please destroy and notify sender.  Sender
  does not waive confidentiality or privilege, and use is prohibited.
 
  

Re: Struts cannot support relative uri ?

2003-10-28 Thread Ruth, Brice
If relative URIs work or don't work is dependent on the HTML being 
produced, more than anything else, since its the browser that then has 
to request the correct image from the server.

What is the HTML being produced in the cases where you don't see it working?

javen fang wrote:

Hi, all.  I am fajaven from matrix(www.matrix.org.cn)
in China.
I wonder it seems like Struts cannot support relative
uri.
In tomcat 5.0 , my webapp looks like:
tomcat/webapps/asales
Two files are:
tomcat/webapps/asales/pages/left.jsp
tomcat/webapps/asales/pages/images/logo.jpg
Normally, in left.jsp, I use logo.jpg, like this:
img src=images/logo.jpg/
but if in left.jsp include struts tags, or it mapping
from struts action, then relative uri will fail, and
absolute uri is required:
img src=/asales/pages/images/logo.jpg/
You know, relative uri cannot be used is not
convinient very much.
How can I solve this question? 

Thanks.

javen fang from matrix

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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

--
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.


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


Re: Struts cannot support relative uri ?

2003-10-28 Thread George Steimer
Do you have a html:base/ tag within your html head element?

 Hi, all.  I am fajaven from matrix(www.matrix.org.cn)
 in China.
 
 I wonder it seems like Struts cannot support relative
 uri.
 
 In tomcat 5.0 , my webapp looks like:
 tomcat/webapps/asales
 
 Two files are:
 tomcat/webapps/asales/pages/left.jsp
 tomcat/webapps/asales/pages/images/logo.jpg
 
 Normally, in left.jsp, I use logo.jpg, like this:
 img src=images/logo.jpg/
 
 but if in left.jsp include struts tags, or it mapping
 from struts action, then relative uri will fail, and
 absolute uri is required:
 img src=/asales/pages/images/logo.jpg/
 
 You know, relative uri cannot be used is not
 convinient very much.
 
 How can I solve this question? 
 
 Thanks.
 
 javen fang from matrix
 
 __
 Do You Yahoo!?
 Tired of spam?  Yahoo! Mail has the best spam protection around 
 http://mail.yahoo.com 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


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



Re: Struts cannot support relative uri ?

2003-10-28 Thread javen fang
but if in left.jsp include struts tags, or it mapping
from struts action, then relative uri will fail, and
absolute uri is required:
img src=/asales/pages/images/logo.jpg/

If in this condition, I do like this:
img src=images/logo.jsp/

then html is : http:/localhost/images/logo.jsp
so I think asales/pages/ is required.


--- Ruth, Brice [EMAIL PROTECTED] wrote:
 If relative URIs work or don't work is dependent on
 the HTML being 
 produced, more than anything else, since its the
 browser that then has 
 to request the correct image from the server.
 
 What is the HTML being produced in the cases where
 you don't see it working?
 
 javen fang wrote:
 
 Hi, all.  I am fajaven from
 matrix(www.matrix.org.cn)
 in China.
 
 I wonder it seems like Struts cannot support
 relative
 uri.
 
 In tomcat 5.0 , my webapp looks like:
 tomcat/webapps/asales
 
 Two files are:
 tomcat/webapps/asales/pages/left.jsp
 tomcat/webapps/asales/pages/images/logo.jpg
 
 Normally, in left.jsp, I use logo.jpg, like this:
 img src=images/logo.jpg/
 
 but if in left.jsp include struts tags, or it
 mapping
 from struts action, then relative uri will fail,
 and
 absolute uri is required:
 img src=/asales/pages/images/logo.jpg/
 
 You know, relative uri cannot be used is not
 convinient very much.
 
 How can I solve this question? 
 
 Thanks.
 
 javen fang from matrix
 
 __
 Do You Yahoo!?
 Tired of spam?  Yahoo! Mail has the best spam
 protection around 
 http://mail.yahoo.com 
 

-
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
 
   
 
 
 -- 
 Brice D. Ruth
 Sr. IT Analyst
 Fiskars Brands, Inc.
 
 
 

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


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



Re: please help: ActionForms of same type but different name?

2003-10-28 Thread Sonam Belbase

Continued..

So there are two levels of distinction here - the first one being
between
LoginFormTypeA and LoginFormTypeB. But that is no big issue since
the actions that map to them are different.

So when m of n is submitted, the request processor knows whether
m is of type LoginFormTypeA or of type LoginFormTypeB. Problem
is that you cannot have multiple html:form elements on a page,
all with the same name LoginFormTypeA or LoginFormTypeB.
This is why we gave them different names through iteration-
LoginFormA_1, LoginFormA_2, LoginFormB_1,
etc. When LoginFormA_1 is submitted, you would think that
the request processor would look for a form called LoginFormA_1
and form.get(userName) would return the value of LoginFormA_1's
userName property. This doesn't happen.

Instead, the request processor looks at the action associated with the
submitted form, sees that it is loginActionA, looks for the
associated form (which from the action-mapping is LoginFormTypeA)
and since it cannot find one, creates one. Thus form.get(userName)
returns null.

Hope this is not too confusing!

: ) SB

Sonam Belbase wrote:

 Tim,

 We do have the same form and the same action and more
 specifically, we have the LoginFormTypeA processed by loginActionA
 and LoginFormTypeB processed by loginActionB. Of the
 5 login forms, three could be of type A, 2 could be of type B.

 Chen, Gin wrote:

  The problem here is that with 5 login forms.. How would you know or even
  care which of the 5 was used to submit?
  Is it processed differently if I pick m of n versus x of n?
  In any case sounds like what you really want is the same form and the same
  action.
  Ie..
 
  I might have a bean such that it only contains one parameter.
  (don't mind syntax as stupid outlook keeps trying to apply spelling and
  grammer rules which I don't want to turn off cause I'm the worst
  speller/grammulator)
 
  form-bean name=loginForm
  type=org.apache.struts.validator.DynaValidatorForm
  form-property name=formIteration
  type=java.lang.Integer/
  /form-bean
 
  This bean is mapped to the same action. (ex. /loginAction)
 
  Then for my JSP :
  //remember n is simulated ie. don't put n in end (duh) :)
  c:forEach var=loopCnt begin=1 end=n
   html:form action=/loginAction
html-el:hidden property=formIteration
  value=${loopCnt}/
html:submit property=userAction
   bean:message key=button.login/
/html:submit
   /html:form
  /c:forEach
 
  Now your action is pretty simple.
  Based on the formIteration value you know which of the n forms was used to
  login.
  Hope that helps.
  -Tim
 
  -Original Message-
  From: Sonam Belbase [mailto:[EMAIL PROTECTED]
  Sent: Monday, October 27, 2003 6:37 PM
  To: Struts Users Mailing List
  Subject: Re: please help: ActionForms of same type but different name?
 
  There is no knowing until runtime how many iterations there are going to be.
  That's why we can't define the n number of LoginForms.
 
  The requirement is that on the same jsp, we will have repeating
  html:form/html:form sections. User will specify at runtime
  how many he/she wants. The html:forms will all be of the same
  type. Restriction is that only one can be submitted at a time, i.e. user
  might have specified 5 Login sections of the page, and therefore is shown 5
  login sections,  but can only save one at a time.
 
  The save action needs to know which form to retrieve the values
  username and password from.
 
  SB
 
  Chen, Gin wrote:
 
   One approach, you can define as many form-beans as you want iteratations.
   Ex:
   form-bean name=LoginForm_1
 type=com.oreilly.struts.storefront.security.LoginForm
   /form-bean
   form-bean name=LoginForm_2
 type=com.oreilly.struts.storefront.security.LoginForm
   /form-bean
   .
   .
   .
   form-bean name=LoginForm_n
 type=com.oreilly.struts.storefront.security.LoginForm
   /form-bean
  
   You can also just use a single form bean for all your actions.. If they
  are
   the same class then they are the same formbean anyways.
   So just use the same name for all of them (well not html:form name in
  Struts
   1.1+ but rather use name in action definition).
   Or If you explain your requirements a bit more we could come up with a
   better solution/explanation.
   -Tim
  
   -Original Message-
   From: Sonam Belbase [mailto:[EMAIL PROTECTED]
   Sent: Monday, October 27, 2003 6:16 PM
   To: Struts Users Mailing List
   Subject: please help: ActionForms of same type but different name?
  
   Given the following code in my jsp:
  
   logic:iterate id=element name=dynamicFormList
   type=java.lang.String 
   html:form  action=/login name=%=element%
   type=com.oreilly.struts.storefront.security.LoginForm
  
 User Name:
 html:text property=userName size=20 maxlength=50/
 Password:
 

Re: Struts cannot support relative uri ?

2003-10-28 Thread Mark Lowe
Try this like George said

head

html:base /

/head

Cheers Mark

On Tuesday, October 28, 2003, at 03:55 PM, javen fang wrote:

but if in left.jsp include struts tags, or it mapping
from struts action, then relative uri will fail, and
absolute uri is required:
img src=/asales/pages/images/logo.jpg/
If in this condition, I do like this:
img src=images/logo.jsp/
then html is : http:/localhost/images/logo.jsp
so I think asales/pages/ is required.
--- Ruth, Brice [EMAIL PROTECTED] wrote:
If relative URIs work or don't work is dependent on
the HTML being
produced, more than anything else, since its the
browser that then has
to request the correct image from the server.
What is the HTML being produced in the cases where
you don't see it working?
javen fang wrote:

Hi, all.  I am fajaven from
matrix(www.matrix.org.cn)
in China.

I wonder it seems like Struts cannot support
relative
uri.

In tomcat 5.0 , my webapp looks like:
tomcat/webapps/asales
Two files are:
tomcat/webapps/asales/pages/left.jsp
tomcat/webapps/asales/pages/images/logo.jpg
Normally, in left.jsp, I use logo.jpg, like this:
img src=images/logo.jpg/
but if in left.jsp include struts tags, or it
mapping
from struts action, then relative uri will fail,
and
absolute uri is required:
img src=/asales/pages/images/logo.jpg/
You know, relative uri cannot be used is not
convinient very much.
How can I solve this question?

Thanks.

javen fang from matrix

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam
protection around
http://mail.yahoo.com

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



--
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.



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


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


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


Re: Struts cannot support relative uri ?

2003-10-28 Thread Mahin Jeyachandran
good day all,

I'm new to struts frame work...

I'm using a property file names languages.properties instead of =
ApplicationResources.properties
Also I have an entry in my struts-config.xml like the following...

message-resources property=3Dlanguage /

I also placed the property file in WEB-INF/classes/
but it seems that the property file languages.properties is not =
detected.

shld I make any changes or any entry in the web.xml to make my new =
property file visible 

I'm using web-logic6.1.

pls help..

Regards,
Mahin
AddVal Technology Inc.


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



Re: Struts cannot support relative uri ?

2003-10-28 Thread Ruth, Brice
Are you using the struts html:img tag?! Otherwise, if you only have img 
src=images/logo.jpg in your JSP, then the HTML that is output won't 
be anything other than img src=images/logo.jpg - Struts/Tomcat/or 
any other container/framework passes through any non-JSP tags like HTML 
as is.

Send the exact HTML that is in your JSP and the exact HTML that is 
output when you load the page in a browser. Include the exact URI that 
you use to load the page, too.

javen fang wrote:

but if in left.jsp include struts tags, or it mapping
   

from struts action, then relative uri will fail, and
 

absolute uri is required:
img src=/asales/pages/images/logo.jpg/
   

If in this condition, I do like this:
img src=images/logo.jsp/
then html is : http:/localhost/images/logo.jsp
so I think asales/pages/ is required.
--- Ruth, Brice [EMAIL PROTECTED] wrote:
 

If relative URIs work or don't work is dependent on
the HTML being 
produced, more than anything else, since its the
browser that then has 
to request the correct image from the server.

What is the HTML being produced in the cases where
you don't see it working?
javen fang wrote:

   

Hi, all.  I am fajaven from
 

matrix(www.matrix.org.cn)
   

in China.

I wonder it seems like Struts cannot support
 

relative
   

uri.

In tomcat 5.0 , my webapp looks like:
tomcat/webapps/asales
Two files are:
tomcat/webapps/asales/pages/left.jsp
tomcat/webapps/asales/pages/images/logo.jpg
Normally, in left.jsp, I use logo.jpg, like this:
img src=images/logo.jpg/
but if in left.jsp include struts tags, or it
 

mapping
from struts action, then relative uri will fail,
and
   

absolute uri is required:
img src=/asales/pages/images/logo.jpg/
You know, relative uri cannot be used is not
convinient very much.
How can I solve this question? 

Thanks.

javen fang from matrix

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam
 

protection around 
   

http://mail.yahoo.com 

 

-
   

To unsubscribe, e-mail:
 

[EMAIL PROTECTED]
   

For additional commands, e-mail:
 

[EMAIL PROTECTED]
   



 

--
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.


   

-
 

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



__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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

--
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.


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


Re: Exception handling - please help!

2003-10-28 Thread Pratik Patel
=?iso-8859-1?B?QuVyZCBBcnZlIEV2amVu ?= wrote:
Hi,

I'm trying hard not to rip out hair from my scalp. I cannot get the exception handling in struts to work. What am I doing wrong? Please help me before I go insane...
You are actually handling the exception in your Action class. You have 
to pass the exception up the (method) stack if you want to use the 
Struts exception handler.

The action's method signature should be something like this:

public SearchTradesAction extends Action throws Exception

and you must remove the catch statements in the Action.

Also, you will likely need a custom exception handler to populate 
ActionError messages.

Have a look here for some tips for Exception handling with Struts:

http://www.jroller.com/page/prpatel/20031023

cheers
Pratik


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


Forward Cannot Be Achieved In One Step

2003-10-28 Thread Caroline Jen
Hi, I have the following code in the navbarMenu.jsp:

html:link forward=exitLOGOUT/html:link

and in the struts-config.xml, I have:

forward
   name=exit
   path=/do/Logoff/

and 

action 
   path=/Logoff
   type=org.NameOfOrganization.signoff.LogoffAction
 forward
 name=success
 path=/do/Menu/
/action

In the LogoffAction.java, I invalidate the session and
I want the user to go back the welcome page.

The problem is that it takes two steps for the user to
go back to the welcome page - After the first click,
the same screen remains in the browser.  The only
change is what is shown in the address bar.  I have to
click the LOGOFF button again and then the welcome
page is displayed.  

What should I do to go back to the welcome page in one step?

__
Do you Yahoo!?
Exclusive Video Premiere - Britney Spears
http://launch.yahoo.com/promos/britneyspears/

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



application.properties

2003-10-28 Thread Zhou, Qin (Eric)

Can website pick up the changes from application.properties using some way, but 
without bouncing the applicaiton server?

Eric Zhou


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



Pass XML fragment to tile?

2003-10-28 Thread Ruth, Brice
I have an x:forEach loop (JSTL) that contains within it a tiles:insert 
statement - and I'd like to pass the current node of XML to the tile for 
additional processing (conditionally). Is this possible? Within the 
tile, I'll need to do an x:forEach loop on the passed in fragment, so I 
believe I'll need to be able to use x:parse on the fragment that was 
passed in. I'm open to other ways of doing this, as well, but they need 
to only involve what can be done within a JSP/tile, really. I'm 
extending an existing set of code, and am not really open to rewriting 
it all :)

--
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.


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


Re: Forward Cannot Be Achieved In One Step

2003-10-28 Thread Ruth, Brice
Is your Menu actionforward the welcome screen you want to get to? And 
does your Action return an ActionForward to this?

Caroline Jen wrote:

Hi, I have the following code in the navbarMenu.jsp:

html:link forward=exitLOGOUT/html:link

and in the struts-config.xml, I have:

forward
  name=exit
  path=/do/Logoff/
and 

action 
  path=/Logoff
  type=org.NameOfOrganization.signoff.LogoffAction
forward
name=success
path=/do/Menu/
/action

In the LogoffAction.java, I invalidate the session and
I want the user to go back the welcome page.
The problem is that it takes two steps for the user to
go back to the welcome page - After the first click,
the same screen remains in the browser.  The only
change is what is shown in the address bar.  I have to
click the LOGOFF button again and then the welcome
page is displayed.  

What should I do to go back to the welcome page in one step?

__
Do you Yahoo!?
Exclusive Video Premiere - Britney Spears
http://launch.yahoo.com/promos/britneyspears/
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 

--
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.


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


Re: application.properties

2003-10-28 Thread Ruth, Brice
You can probably reload or stop/start the individual application, whilst 
leaving the application server running. At least, this is what I do with 
Tomcat all the time ...

Zhou, Qin (Eric) wrote:

Can website pick up the changes from application.properties using some way, but without bouncing the applicaiton server?

Eric Zhou

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

--
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.


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


Re: application.properties

2003-10-28 Thread Nathan Maves
I use Sun's application server but when I do this all web applications 
reload when you deploy a new one out there.  Does Tomcat do this as 
well?

Nathan
On Oct 28, 2003, at 9:48 AM, Ruth, Brice wrote:
You can probably reload or stop/start the individual application, 
whilst leaving the application server running. At least, this is what 
I do with Tomcat all the time ...

Zhou, Qin (Eric) wrote:

Can website pick up the changes from application.properties using 
some way, but without bouncing the applicaiton server?

Eric Zhou

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

--
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.


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


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


Re: Struts cannot support relative uri ?

2003-10-28 Thread javen fang
Thanks very much. 

I lost this tag:  html:base/

And so relative uri is OK. thanks...


--- George Steimer [EMAIL PROTECTED] wrote:
 Do you have a html:base/ tag within your html
 head element?
 
  Hi, all.  I am fajaven from
 matrix(www.matrix.org.cn)
  in China.
  
  I wonder it seems like Struts cannot support
 relative
  uri.
  
  In tomcat 5.0 , my webapp looks like:
  tomcat/webapps/asales
  
  Two files are:
  tomcat/webapps/asales/pages/left.jsp
  tomcat/webapps/asales/pages/images/logo.jpg
  
  Normally, in left.jsp, I use logo.jpg, like this:
  img src=images/logo.jpg/
  
  but if in left.jsp include struts tags, or it
 mapping
  from struts action, then relative uri will fail,
 and
  absolute uri is required:
  img src=/asales/pages/images/logo.jpg/
  
  You know, relative uri cannot be used is not
  convinient very much.
  
  How can I solve this question? 
  
  Thanks.
  
  javen fang from matrix
  
  __
  Do You Yahoo!?
  Tired of spam?  Yahoo! Mail has the best spam
 protection around 
  http://mail.yahoo.com 
  
 

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

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


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



RE: how to access HttpSession in EJB code?

2003-10-28 Thread Greg Dunn
I was having difficulty with something like the reverse of this.  If you
pass the object to your EJB (or in my case a task scheduler), which then
updates it, is there any way to pass it back to store the updated version in
context?

Greg


-Original Message-
From: Andrew Hill [mailto:[EMAIL PROTECTED]
Sent: Monday, October 27, 2003 3:29 AM
To: Struts Users Mailing List
Subject: RE: how to access HttpSession in EJB code?


Hi Viral,
You will need to get the required object from the session up in the p-tier
and pass it to your ejb in a method parameter when you call the EJB (or
facade to it).
(The EJB layer doesnt know about servlets and such like (indeed its client
might well not be a servlet app)).
-Andrew

-Original Message-
From: Viral_Thakkar [mailto:[EMAIL PROTECTED]
Sent: Monday, 27 October 2003 17:21
To: Struts Users Mailing List
Subject: how to access HttpSession in EJB code?


Is there any way, I can access the object from session in the EJB bean
method?

I am keeping the profile object in HttpSession, once the user gets
successfully logged-in. Now I want to access few values from this profile
object which is kept inside session.

The application flow is as below :

Struts Action -- Business Delegate -- Session Façade...

Thanks,
Viral


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


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



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



Sell me on tiles revisited

2003-10-28 Thread Frank Rizzo
Why should we use tiles as opposed to anything else? I am told that this question 
comes often, so the list below has been compiled from this mailing list archive and 
other published articles to consolidate the arguments for using tiles.  If you have 
experience with tiles, please add, modify, or subtract from this list with the goal of 
creating a list that people can use when evaluating whether to use tiles or not on 
their project. 
 
1) Inheritence. Why don't we just use the jsp:include/ tag or @include to include 
common page elements? tiles definitions support inheritence. If you have 60 jsps, you 
have @include header.jsp repeated in every jsp. Next, imagine a new requirement 
dictates that the menu should be moved from the right side to the left. You now have 
to change 60 jsps.  If your application uses tiles, you change only one jsp, all of 
your jsps inherit from this layout jsp. 
 
2) If you have a standard site with a common layout (header, footer, menu, 
bodycontent), tiles does what you want to do very cleanly, integrates with Struts very 
nicely, and is a standard solution that you don't have to develop or document, and 
that your team members may already have experience with or at least be more excited 
about learning than an in-house, one-off system since that experience will have more 
value in the marketplace.
 
3) Using jsp:include or @ include you cannot internationalize parameterized content 
very easily.
 
4) Tiles-defs.xml offers a central document to determine which jsps are used in which 
places. If the developers follow mvc properly, a new person new to the project can get 
a sense of site flow and structure by looking at only struts-config.xml and 
tiles-defs.xml
 
5) You can use a tiles controller rather than write a custom tag. This is especially 
useful for creating a tile such as Amazon's books you've recently browsed. The tile 
can plug in to any page without considering the Struts action code for that URL.
 
6) Tiles scope offers another namespace where attribute names will not collide.



-
Do you Yahoo!?
Exclusive Video Premiere - Britney Spears

Re: Forward Cannot Be Achieved In One Step

2003-10-28 Thread Caroline Jen
The do/Menu does display my welcome page.  The
LOGOUT button and forward does eventually lead the
visitor to the welcome page.  The problem is that it
takes two steps intead of going straight to the
welcome page.  Let me re-state my problem:

I have the following code in the navbarMenu.jsp:

html:link forward=exitLOGOUT/html:link

and in the struts-config.xml, I have:

forward
   name=exit
   path=/do/Logoff/

and 

action 
   path=/Logoff
   type=org.NameOfOrganization.signoff.LogoffAction
 forward
 name=success
 path=/do/Menu/
/action

In the LogoffAction.java, I invalidate the session and
I want the user to go back the welcome page.  And 

action
  path=/Menu
  name=menuForm

type=org.apache.struts.scaffold.ExistsAttributeAction
  parameter=application;HOURS
forward
   name=success
   path=.article.Menu/
forward
   name=failure
   path=/do/MenuCreate/

The .article.Menu is my tile that displays the welcome
page.

The problem is that it takes two steps for the user to
go back to the welcome page - After the first click,
the same screen remains in the browser.  The only
change is what is shown in the address bar.  I have to
click the LOGOFF button again and then the welcome
page is displayed.  

What should I do to go back to the welcome page in one
step?

--- Ruth, Brice [EMAIL PROTECTED] wrote:
 Is your Menu actionforward the welcome screen you
 want to get to? And 
 does your Action return an ActionForward to this?
 
 Caroline Jen wrote:
 
 Hi, I have the following code in the
 navbarMenu.jsp:
 
 html:link forward=exitLOGOUT/html:link
 
 and in the struts-config.xml, I have:
 
 forward
name=exit
path=/do/Logoff/
 
 and 
 
 action 
path=/Logoff
   
 type=org.NameOfOrganization.signoff.LogoffAction
  forward
  name=success
  path=/do/Menu/
 /action
 
 In the LogoffAction.java, I invalidate the session
 and
 I want the user to go back the welcome page.
 
 The problem is that it takes two steps for the user
 to
 go back to the welcome page - After the first
 click,
 the same screen remains in the browser.  The only
 change is what is shown in the address bar.  I have
 to
 click the LOGOFF button again and then the welcome
 page is displayed.  
 
 What should I do to go back to the welcome page in
 one step?
 
 __
 Do you Yahoo!?
 Exclusive Video Premiere - Britney Spears
 http://launch.yahoo.com/promos/britneyspears/
 

-
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
 
   
 
 
 -- 
 Brice D. Ruth
 Sr. IT Analyst
 Fiskars Brands, Inc.
 
 
 

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


__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

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



RE: application.properties

2003-10-28 Thread Paananen, Tero
 Can website pick up the changes from application.properties 
 using some way, but without bouncing the applicaiton server?

This is discussed on the list every other week.
The answer is in the list archives.

Summary: implement refreshing on your own. It's fairly
simple to do.

-TPP

-
This email may contain confidential and privileged material for the sole use of the 
intended recipient(s). Any review, use, retention, distribution or disclosure by 
others is strictly prohibited. If you are not the intended recipient (or authorized to 
receive for the recipient), please contact the sender by reply email and delete all 
copies of this message.  Also, email is susceptible to data corruption, interception, 
tampering, unauthorized amendment and viruses. We only send and receive emails on the 
basis that we are not liable for any such corruption, interception, tampering, 
amendment or viruses or any consequence thereof.


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



RE: application.properties

2003-10-28 Thread Wiebe de Jong
There is a good article at JavaWorld which shows how to use a timer to
reload property files. Check it out at
http://www.javaworld.com/javaworld/javatips/jw-javatip125.html

Wiebe de Jong
http://frontierj.blogspot.com 

-Original Message-
From: Zhou, Qin (Eric) [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, October 28, 2003 8:45 AM
To: [EMAIL PROTECTED]
Subject: application.properties


Can website pick up the changes from application.properties using some way,
but without bouncing the applicaiton server?

Eric Zhou


-
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: Forward Cannot Be Achieved In One Step

2003-10-28 Thread Geeta Ramani
Caroline:

ok, I didn't sleep enough last night so I may be blabbering(:(, but why
don't you simply say:

html:link page=/LogoffLOGOUT/html:link

and lose the forward entry in your struts-config.xml?

Geeta

Caroline Jen wrote:

 The do/Menu does display my welcome page.  The
 LOGOUT button and forward does eventually lead the
 visitor to the welcome page.  The problem is that it
 takes two steps intead of going straight to the
 welcome page.  Let me re-state my problem:

 I have the following code in the navbarMenu.jsp:

 html:link forward=exitLOGOUT/html:link

 and in the struts-config.xml, I have:

 forward
name=exit
path=/do/Logoff/

 and

 action
path=/Logoff
type=org.NameOfOrganization.signoff.LogoffAction
  forward
  name=success
  path=/do/Menu/
 /action

 In the LogoffAction.java, I invalidate the session and
 I want the user to go back the welcome page.  And

 action
   path=/Menu
   name=menuForm

 type=org.apache.struts.scaffold.ExistsAttributeAction
   parameter=application;HOURS
 forward
name=success
path=.article.Menu/
 forward
name=failure
path=/do/MenuCreate/

 The .article.Menu is my tile that displays the welcome
 page.

 The problem is that it takes two steps for the user to
 go back to the welcome page - After the first click,
 the same screen remains in the browser.  The only
 change is what is shown in the address bar.  I have to
 click the LOGOFF button again and then the welcome
 page is displayed.

 What should I do to go back to the welcome page in one
 step?

 --- Ruth, Brice [EMAIL PROTECTED] wrote:
  Is your Menu actionforward the welcome screen you
  want to get to? And
  does your Action return an ActionForward to this?
 
  Caroline Jen wrote:
 
  Hi, I have the following code in the
  navbarMenu.jsp:
  
  html:link forward=exitLOGOUT/html:link
  
  and in the struts-config.xml, I have:
  
  forward
 name=exit
 path=/do/Logoff/
  
  and
  
  action
 path=/Logoff
  
  type=org.NameOfOrganization.signoff.LogoffAction
   forward
   name=success
   path=/do/Menu/
  /action
  
  In the LogoffAction.java, I invalidate the session
  and
  I want the user to go back the welcome page.
  
  The problem is that it takes two steps for the user
  to
  go back to the welcome page - After the first
  click,
  the same screen remains in the browser.  The only
  change is what is shown in the address bar.  I have
  to
  click the LOGOFF button again and then the welcome
  page is displayed.
  
  What should I do to go back to the welcome page in
  one step?
  
  __
  Do you Yahoo!?
  Exclusive Video Premiere - Britney Spears
  http://launch.yahoo.com/promos/britneyspears/
  
 
 -
  To unsubscribe, e-mail:
  [EMAIL PROTECTED]
  For additional commands, e-mail:
  [EMAIL PROTECTED]
  
  
  
 
  --
  Brice D. Ruth
  Sr. IT Analyst
  Fiskars Brands, Inc.
 
 
 
 
 -
  To unsubscribe, e-mail:
  [EMAIL PROTECTED]
  For additional commands, e-mail:
  [EMAIL PROTECTED]
 

 __
 Do you Yahoo!?
 The New Yahoo! Shopping - with improved product search
 http://shopping.yahoo.com

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


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



Re: application.properties

2003-10-28 Thread Ruth, Brice
nope

Nathan Maves wrote:

I use Sun's application server but when I do this all web applications 
reload when you deploy a new one out there.  Does Tomcat do this as well?

Nathan
On Oct 28, 2003, at 9:48 AM, Ruth, Brice wrote:
You can probably reload or stop/start the individual application, 
whilst leaving the application server running. At least, this is what 
I do with Tomcat all the time ...

Zhou, Qin (Eric) wrote:

Can website pick up the changes from application.properties using 
some way, but without bouncing the applicaiton server?

Eric Zhou

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

--
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.


-
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]
--
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.


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


Re: Pass XML fragment to tile?

2003-10-28 Thread Ruth, Brice
ah, right - the 'var' attribute, forgot about that. I was just accessing 
the context node, which is devoid of XML markup. Lemme try that.

Kris Schneider wrote:

I don't know much about Tiles, but x:forEach can explicitly export a scoped
variable via its var attribute:
x:forEach var=node select=...

It also implicitly sets the context node each time through an iteration. So, I'm
assuming that another XPath expression within the tile would operate realtive to
the context set by x:forEach. If you know Tiles and have some handy test XML
data, it shouldn't be too hard to test out either (or both) of those approaches...
Quoting Ruth, Brice [EMAIL PROTECTED]:

 

I have an x:forEach loop (JSTL) that contains within it a tiles:insert 
statement - and I'd like to pass the current node of XML to the tile for 
additional processing (conditionally). Is this possible? Within the 
tile, I'll need to do an x:forEach loop on the passed in fragment, so I 
believe I'll need to be able to use x:parse on the fragment that was 
passed in. I'm open to other ways of doing this, as well, but they need 
to only involve what can be done within a JSP/tile, really. I'm 
extending an existing set of code, and am not really open to rewriting 
it all :)

--
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.
   

 

--
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.


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


RE: Forward Cannot Be Achieved In One Step

2003-10-28 Thread shishir.katdare
u can also use 
html:link action=/Logofflogoff/html:link
where logoff is ur global forward.
html:link forward=/Logofflogoff/html:link
hence it wont be a 2 step stuff but directly calling ur Action class which does 
cleanup work for the log off process as session cleaning up and invalidating the other 
objects (probably signing off the user), And forwards later on to one of the jsp's 
U can create a global forward for the same too which represents an action.
I guess its only available in 1.1 version of Struts.


-Original Message-
From: Caroline Jen [mailto:[EMAIL PROTECTED]
Sent: 28 October 2003 17:05
To: Struts Users Mailing List
Subject: Re: Forward Cannot Be Achieved In One Step


The do/Menu does display my welcome page.  The
LOGOUT button and forward does eventually lead the
visitor to the welcome page.  The problem is that it
takes two steps intead of going straight to the
welcome page.  Let me re-state my problem:

I have the following code in the navbarMenu.jsp:

html:link forward=exitLOGOUT/html:link

and in the struts-config.xml, I have:

forward
   name=exit
   path=/do/Logoff/

and 

action 
   path=/Logoff
   type=org.NameOfOrganization.signoff.LogoffAction
 forward
 name=success
 path=/do/Menu/
/action

In the LogoffAction.java, I invalidate the session and
I want the user to go back the welcome page.  And 

action
  path=/Menu
  name=menuForm

type=org.apache.struts.scaffold.ExistsAttributeAction
  parameter=application;HOURS
forward
   name=success
   path=.article.Menu/
forward
   name=failure
   path=/do/MenuCreate/

The .article.Menu is my tile that displays the welcome
page.

The problem is that it takes two steps for the user to
go back to the welcome page - After the first click,
the same screen remains in the browser.  The only
change is what is shown in the address bar.  I have to
click the LOGOFF button again and then the welcome
page is displayed.  

What should I do to go back to the welcome page in one
step?

--- Ruth, Brice [EMAIL PROTECTED] wrote:
 Is your Menu actionforward the welcome screen you
 want to get to? And 
 does your Action return an ActionForward to this?
 
 Caroline Jen wrote:
 
 Hi, I have the following code in the
 navbarMenu.jsp:
 
 html:link forward=exitLOGOUT/html:link
 
 and in the struts-config.xml, I have:
 
 forward
name=exit
path=/do/Logoff/
 
 and 
 
 action 
path=/Logoff
   
 type=org.NameOfOrganization.signoff.LogoffAction
  forward
  name=success
  path=/do/Menu/
 /action
 
 In the LogoffAction.java, I invalidate the session
 and
 I want the user to go back the welcome page.
 
 The problem is that it takes two steps for the user
 to
 go back to the welcome page - After the first
 click,
 the same screen remains in the browser.  The only
 change is what is shown in the address bar.  I have
 to
 click the LOGOFF button again and then the welcome
 page is displayed.  
 
 What should I do to go back to the welcome page in
 one step?
 
 __
 Do you Yahoo!?
 Exclusive Video Premiere - Britney Spears
 http://launch.yahoo.com/promos/britneyspears/
 

-
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
 
   
 
 
 -- 
 Brice D. Ruth
 Sr. IT Analyst
 Fiskars Brands, Inc.
 
 
 

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


__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

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


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

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

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


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



Re: Pass XML fragment to tile?

2003-10-28 Thread Ruth, Brice
Hrmpf, not working they way I expected.

When I add var=node to my x:forEach, and then use c:out 
value=${node}/ to display the contents (as this is what would be 
passed to the Tile, via tiles:put) - I get the following:

[category: null]

The XPath statement I am using as my select for the forEach, has as its 
last node, category ... what I would hope to get is either something 
like this:

category order=3 nameKey=nav.section.whatever
   family order=1whatever/family
   ...
/category
-OR- just the list of family nodes.

Kris Schneider wrote:

I don't know much about Tiles, but x:forEach can explicitly export a scoped
variable via its var attribute:
x:forEach var=node select=...

It also implicitly sets the context node each time through an iteration. So, I'm
assuming that another XPath expression within the tile would operate realtive to
the context set by x:forEach. If you know Tiles and have some handy test XML
data, it shouldn't be too hard to test out either (or both) of those approaches...
Quoting Ruth, Brice [EMAIL PROTECTED]:

 

I have an x:forEach loop (JSTL) that contains within it a tiles:insert 
statement - and I'd like to pass the current node of XML to the tile for 
additional processing (conditionally). Is this possible? Within the 
tile, I'll need to do an x:forEach loop on the passed in fragment, so I 
believe I'll need to be able to use x:parse on the fragment that was 
passed in. I'm open to other ways of doing this, as well, but they need 
to only involve what can be done within a JSP/tile, really. I'm 
extending an existing set of code, and am not really open to rewriting 
it all :)

--
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.
   

 

--
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.


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


RE: Forward Cannot Be Achieved In One Step

2003-10-28 Thread shishir.katdare
forward from /Logoff action need to go to welcome screen (jsp) not via another action.

-Original Message-
From: Caroline Jen [mailto:[EMAIL PROTECTED]
Sent: 28 October 2003 17:05
To: Struts Users Mailing List
Subject: Re: Forward Cannot Be Achieved In One Step


The do/Menu does display my welcome page.  The
LOGOUT button and forward does eventually lead the
visitor to the welcome page.  The problem is that it
takes two steps intead of going straight to the
welcome page.  Let me re-state my problem:

I have the following code in the navbarMenu.jsp:

html:link forward=exitLOGOUT/html:link

and in the struts-config.xml, I have:

forward
   name=exit
   path=/do/Logoff/

and 

action 
   path=/Logoff
   type=org.NameOfOrganization.signoff.LogoffAction
 forward
 name=success
 path=/do/Menu/
/action

In the LogoffAction.java, I invalidate the session and
I want the user to go back the welcome page.  And 

action
  path=/Menu
  name=menuForm

type=org.apache.struts.scaffold.ExistsAttributeAction
  parameter=application;HOURS
forward
   name=success
   path=.article.Menu/
forward
   name=failure
   path=/do/MenuCreate/

The .article.Menu is my tile that displays the welcome
page.

The problem is that it takes two steps for the user to
go back to the welcome page - After the first click,
the same screen remains in the browser.  The only
change is what is shown in the address bar.  I have to
click the LOGOFF button again and then the welcome
page is displayed.  

What should I do to go back to the welcome page in one
step?

--- Ruth, Brice [EMAIL PROTECTED] wrote:
 Is your Menu actionforward the welcome screen you
 want to get to? And 
 does your Action return an ActionForward to this?
 
 Caroline Jen wrote:
 
 Hi, I have the following code in the
 navbarMenu.jsp:
 
 html:link forward=exitLOGOUT/html:link
 
 and in the struts-config.xml, I have:
 
 forward
name=exit
path=/do/Logoff/
 
 and 
 
 action 
path=/Logoff
   
 type=org.NameOfOrganization.signoff.LogoffAction
  forward
  name=success
  path=/do/Menu/
 /action
 
 In the LogoffAction.java, I invalidate the session
 and
 I want the user to go back the welcome page.
 
 The problem is that it takes two steps for the user
 to
 go back to the welcome page - After the first
 click,
 the same screen remains in the browser.  The only
 change is what is shown in the address bar.  I have
 to
 click the LOGOFF button again and then the welcome
 page is displayed.  
 
 What should I do to go back to the welcome page in
 one step?
 
 __
 Do you Yahoo!?
 Exclusive Video Premiere - Britney Spears
 http://launch.yahoo.com/promos/britneyspears/
 

-
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
 
   
 
 
 -- 
 Brice D. Ruth
 Sr. IT Analyst
 Fiskars Brands, Inc.
 
 
 

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


__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

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


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

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

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


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



Re: Pass XML fragment to tile?

2003-10-28 Thread Kris Schneider
That's fine, isn't it? It should just be the string representation of the
context node (i.e. nodeclass.toString()). What if you do:

x:forEach select=$xml//catalog
  nameKey: x:out select=@nameKey/
/x:forEach

Quoting Ruth, Brice [EMAIL PROTECTED]:

 Hrmpf, not working they way I expected.
 
 When I add var=node to my x:forEach, and then use c:out 
 value=${node}/ to display the contents (as this is what would be 
 passed to the Tile, via tiles:put) - I get the following:
 
 [category: null]
 
 The XPath statement I am using as my select for the forEach, has as its 
 last node, category ... what I would hope to get is either something 
 like this:
 
 category order=3 nameKey=nav.section.whatever
 family order=1whatever/family
 ...
 /category
 
 -OR- just the list of family nodes.
 
 Kris Schneider wrote:
 
 I don't know much about Tiles, but x:forEach can explicitly export a
 scoped
 variable via its var attribute:
 
 x:forEach var=node select=...
 
 It also implicitly sets the context node each time through an iteration. So,
 I'm
 assuming that another XPath expression within the tile would operate
 realtive to
 the context set by x:forEach. If you know Tiles and have some handy test
 XML
 data, it shouldn't be too hard to test out either (or both) of those
 approaches...
 
 Quoting Ruth, Brice [EMAIL PROTECTED]:
 
   
 
 I have an x:forEach loop (JSTL) that contains within it a tiles:insert 
 statement - and I'd like to pass the current node of XML to the tile for 
 additional processing (conditionally). Is this possible? Within the 
 tile, I'll need to do an x:forEach loop on the passed in fragment, so I 
 believe I'll need to be able to use x:parse on the fragment that was 
 passed in. I'm open to other ways of doing this, as well, but they need 
 to only involve what can be done within a JSP/tile, really. I'm 
 extending an existing set of code, and am not really open to rewriting 
 it all :)
 
 -- 
 Brice D. Ruth
 Sr. IT Analyst
 Fiskars Brands, Inc.
 
 
 
   
 
 
 -- 
 Brice D. Ruth
 Sr. IT Analyst
 Fiskars Brands, Inc.

-- 
Kris Schneider mailto:[EMAIL PROTECTED]
D.O.Tech   http://www.dotech.com/

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



Re: Pass XML fragment to tile?

2003-10-28 Thread Ruth, Brice
I'm not having a problem using the proper attributes within the foreach, 
I'm having a problem passing an XML fragment to my Tile. I need to be 
able to pass

family order=1key1/family
family order=2key2/family
...
to the Tile - and that's not happening, as far as I can tell. Within the 
foreach I'm doing a few different things, pulling out nameKey, and 
various other attributes and such - and that's all fine, its actually 
getting the entire node that is the current node and passing that to 
the Tile that seems to be troublesome.

So, my XML for a particular category looks like this:

   category order=8 nameKey=nav.crafts.webcat.trimmers
   family order=1nav.crafts.prdctfm.prsnlppr/family
   family order=2nav.crafts.prdctfm.rtry/family
   /category
So, with my x:forEach XPath statement, the context node is a category 
like this - and I can pull out @nameKey, @order, etc. - to my heart's 
content. I can also do an x:if on family to determine if any family 
nodes exist in the current context - this is all OK.

However, there's processing that the tile I include in my x:forEach 
needs to do that needs this XML fragment (specifically, it needs to loop 
through each family and do something specific, much in the same way that 
the parent is looping through each category and doing something 
specific). So, I need to pass XML like that above, from the current 
context to the Tile ... somehow.

Is this possible?

Kris Schneider wrote:

That's fine, isn't it? It should just be the string representation of the
context node (i.e. nodeclass.toString()). What if you do:
x:forEach select=$xml//catalog
 nameKey: x:out select=@nameKey/
/x:forEach
Quoting Ruth, Brice [EMAIL PROTECTED]:

 

Hrmpf, not working they way I expected.

When I add var=node to my x:forEach, and then use c:out 
value=${node}/ to display the contents (as this is what would be 
passed to the Tile, via tiles:put) - I get the following:

[category: null]

The XPath statement I am using as my select for the forEach, has as its 
last node, category ... what I would hope to get is either something 
like this:

category order=3 nameKey=nav.section.whatever
   family order=1whatever/family
   ...
/category
-OR- just the list of family nodes.

Kris Schneider wrote:

   

I don't know much about Tiles, but x:forEach can explicitly export a
 

scoped
   

variable via its var attribute:

x:forEach var=node select=...

It also implicitly sets the context node each time through an iteration. So,
 

I'm
   

assuming that another XPath expression within the tile would operate
 

realtive to
   

the context set by x:forEach. If you know Tiles and have some handy test
 

XML
   

data, it shouldn't be too hard to test out either (or both) of those
 

approaches...
   

Quoting Ruth, Brice [EMAIL PROTECTED]:



 

I have an x:forEach loop (JSTL) that contains within it a tiles:insert 
statement - and I'd like to pass the current node of XML to the tile for 
additional processing (conditionally). Is this possible? Within the 
tile, I'll need to do an x:forEach loop on the passed in fragment, so I 
believe I'll need to be able to use x:parse on the fragment that was 
passed in. I'm open to other ways of doing this, as well, but they need 
to only involve what can be done within a JSP/tile, really. I'm 
extending an existing set of code, and am not really open to rewriting 
it all :)

--
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.
  

   



 

--
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.
   

 

--
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.


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


code generate by validwhen doesn't exists

2003-10-28 Thread Ruben Orta Magan
Hello again. I'm fighting with validwhen againi've got the lastest nightly 
build(jakarta-struts-20031027.zip) and it looks like when you use validwhen validation 
no javascript code is generated and inserted in the jsp file. If i use this validation 
definition:

field
property=tituloRevista
depends=required
arg0 key=icytReviForm.tituloRevista.displayname/


/field

field 
property=tipoAdquisicion
depends=required
arg0 key=icytReviForm.tipoAdquisicion.displayname/
/field   

The javascript code inserted in my jsp page is:

function validateIcytReviForm(form) {  
 
if (bCancel) 
  return true; 
else 
 var formValidationResult;
   formValidationResult = validateRequired(form); 
 return (formValidationResult == 1);
   } 

function required () { 
 this.aa = new Array(tituloRevista, El título es un campo obligatorio, new 
Function (varName,  return this[varName];));
 this.ab = new Array(tipoAdquisicion, El tipo de adquisición es un campo 
obligatorio, new Function (varName,  return this[varName];));
} 


But if I add a new field validation in my validation.xml :

field
property=tituloRevista
depends=required
arg0 key=icytReviForm.tituloRevista.displayname/


/field

field 
property=tipoAdquisicion
depends=required
arg0 key=icytReviForm.tipoAdquisicion.displayname/
/field   


!-- new field --
field 
property=tituloAbreviado
depends=validwhen
arg0 key=icytReviForm.tituloAbreviado.displayname/
  var
var-nametest/var-name
var-value(tituloRevista != null)/var-value
  /var
/field 

The javascript code generated is the same!

function validateIcytReviForm(form) {  
 
if (bCancel) 
  return true; 
else 
 var formValidationResult;
   formValidationResult = validateRequired(form); 
 return (formValidationResult == 1);
   } 

function required () { 
 this.aa = new Array(tituloRevista, El título es un campo obligatorio, new 
Function (varName,  return this[varName];));
 this.ab = new Array(tipoAdquisicion, El tipo de adquisición es un campo 
obligatorio, new Function (varName,  return this[varName];));
} 

Please someone can help me??? is the validwhen running correctly? is the problem in 
the definition??? 

Thanks...

Re: wildcard matching support

2003-10-28 Thread Vic Cekvenich
I think nightly build (Struts 1.2) has it.
.V
Sonam Belbase wrote:
Hi,

I am looking to use Wildcard matching support for my action mappings.
I am currently using Struts 1.1 .
This feature does not seem to be supported in the build I have .
If any one has used the WildCardMatching support in struts ,I would like

to know the release build to use to pick up these classes.

Any information would be extremely useful.

Thanks.

SB

--
NOTICE: If received in error, please destroy and notify sender.  Sender
does not waive confidentiality or privilege, and use is prohibited.
--
Victor Cekvenich,
Struts Instructor
(215) 321-9146
Advanced Struts Training
http://basebeans.com/do/cmsPg?content=TRAINING Server Side Java
training with Rich UI, mentoring, designs, samples and project recovery
in North East.
Simple best practice basic Portal, a Struts CMS, Membership, Forums,
Shopping and Credit processing, http://basicportal.com software, ready
to develop/customize; requires a db to run.


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


RE: code generate by validwhen doesn't exists

2003-10-28 Thread Matt Raible
I don't believe that requiredif or validwhen generate client-side
(JavaScript) validation.

Matt

-Original Message-
From: Ruben Orta Magan [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 28, 2003 10:56 AM
To: Struts Users Mailing List
Subject: code generate by validwhen doesn't exists


Hello again. I'm fighting with validwhen againi've got the lastest
nightly build(jakarta-struts-20031027.zip) and it looks like when you use
validwhen validation no javascript code is generated and inserted in the jsp
file. If i use this validation definition:

field
property=tituloRevista
depends=required
arg0 key=icytReviForm.tituloRevista.displayname/


/field

field 
property=tipoAdquisicion
depends=required
arg0 key=icytReviForm.tipoAdquisicion.displayname/
/field   

The javascript code inserted in my jsp page is:

function validateIcytReviForm(form) {

if (bCancel) 
  return true; 
else 
 var formValidationResult;
   formValidationResult = validateRequired(form); 
 return (formValidationResult == 1);
   } 

function required () { 
 this.aa = new Array(tituloRevista, El título es un campo
obligatorio, new Function (varName,  return this[varName];));
 this.ab = new Array(tipoAdquisicion, El tipo de adquisición es un
campo obligatorio, new Function (varName,  return this[varName];));
} 


But if I add a new field validation in my validation.xml :

field
property=tituloRevista
depends=required
arg0 key=icytReviForm.tituloRevista.displayname/


/field

field 
property=tipoAdquisicion
depends=required
arg0 key=icytReviForm.tipoAdquisicion.displayname/
/field   


!-- new field --
field 
property=tituloAbreviado
depends=validwhen
arg0 key=icytReviForm.tituloAbreviado.displayname/
  var
var-nametest/var-name
var-value(tituloRevista != null)/var-value
  /var
/field 

The javascript code generated is the same!

function validateIcytReviForm(form) {

if (bCancel) 
  return true; 
else 
 var formValidationResult;
   formValidationResult = validateRequired(form); 
 return (formValidationResult == 1);
   } 

function required () { 
 this.aa = new Array(tituloRevista, El título es un campo
obligatorio, new Function (varName,  return this[varName];));
 this.ab = new Array(tipoAdquisicion, El tipo de adquisición es un
campo obligatorio, new Function (varName,  return this[varName];));
} 

Please someone can help me??? is the validwhen running correctly? is the
problem in the definition??? 

Thanks...

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



Re: Pass XML fragment to tile?

2003-10-28 Thread Kris Schneider
Are you doing something like:

x:forEach var=node select=$xml//catalog
  tiles:insert ...
tiles:put beanName=node name=contextNode/
  /tiles:insert
/x:forEach

And then in your tile using contextNode:

x:forEach select=$contextNode/family
  ...

Quoting Ruth, Brice [EMAIL PROTECTED]:

 I'm not having a problem using the proper attributes within the foreach, 
 I'm having a problem passing an XML fragment to my Tile. I need to be 
 able to pass
 
 family order=1key1/family
 family order=2key2/family
 ...
 
 to the Tile - and that's not happening, as far as I can tell. Within the 
 foreach I'm doing a few different things, pulling out nameKey, and 
 various other attributes and such - and that's all fine, its actually 
 getting the entire node that is the current node and passing that to 
 the Tile that seems to be troublesome.
 
 So, my XML for a particular category looks like this:
 
 category order=8 nameKey=nav.crafts.webcat.trimmers
 family order=1nav.crafts.prdctfm.prsnlppr/family
 family order=2nav.crafts.prdctfm.rtry/family
 /category
 
 So, with my x:forEach XPath statement, the context node is a category 
 like this - and I can pull out @nameKey, @order, etc. - to my heart's 
 content. I can also do an x:if on family to determine if any family 
 nodes exist in the current context - this is all OK.
 
 However, there's processing that the tile I include in my x:forEach 
 needs to do that needs this XML fragment (specifically, it needs to loop 
 through each family and do something specific, much in the same way that 
 the parent is looping through each category and doing something 
 specific). So, I need to pass XML like that above, from the current 
 context to the Tile ... somehow.
 
 Is this possible?
 
 Kris Schneider wrote:
 
 That's fine, isn't it? It should just be the string representation of the
 context node (i.e. nodeclass.toString()). What if you do:
 
 x:forEach select=$xml//catalog
   nameKey: x:out select=@nameKey/
 /x:forEach
 
 Quoting Ruth, Brice [EMAIL PROTECTED]:
 
   
 
 Hrmpf, not working they way I expected.
 
 When I add var=node to my x:forEach, and then use c:out 
 value=${node}/ to display the contents (as this is what would be 
 passed to the Tile, via tiles:put) - I get the following:
 
 [category: null]
 
 The XPath statement I am using as my select for the forEach, has as its 
 last node, category ... what I would hope to get is either something 
 like this:
 
 category order=3 nameKey=nav.section.whatever
 family order=1whatever/family
 ...
 /category
 
 -OR- just the list of family nodes.
 
 Kris Schneider wrote:
 
 
 
 I don't know much about Tiles, but x:forEach can explicitly export a
   
 
 scoped
 
 
 variable via its var attribute:
 
 x:forEach var=node select=...
 
 It also implicitly sets the context node each time through an iteration.
 So,
   
 
 I'm
 
 
 assuming that another XPath expression within the tile would operate
   
 
 realtive to
 
 
 the context set by x:forEach. If you know Tiles and have some handy
 test
   
 
 XML
 
 
 data, it shouldn't be too hard to test out either (or both) of those
   
 
 approaches...
 
 
 Quoting Ruth, Brice [EMAIL PROTECTED]:
 
  
 
   
 
 I have an x:forEach loop (JSTL) that contains within it a tiles:insert
 
 statement - and I'd like to pass the current node of XML to the tile for
 
 additional processing (conditionally). Is this possible? Within the 
 tile, I'll need to do an x:forEach loop on the passed in fragment, so I
 
 believe I'll need to be able to use x:parse on the fragment that was 
 passed in. I'm open to other ways of doing this, as well, but they need
 
 to only involve what can be done within a JSP/tile, really. I'm 
 extending an existing set of code, and am not really open to rewriting 
 it all :)
 
 -- 
 Brice D. Ruth
 Sr. IT Analyst
 Fiskars Brands, Inc.

 
 
 
  
 
   
 
 -- 
 Brice D. Ruth
 Sr. IT Analyst
 Fiskars Brands, Inc.
 
 
 
   
 
 
 -- 
 Brice D. Ruth
 Sr. IT Analyst
 Fiskars Brands, Inc.

-- 
Kris Schneider mailto:[EMAIL PROTECTED]
D.O.Tech   http://www.dotech.com/

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



Re: Treeview

2003-10-28 Thread Vic Cekvenich
I use http://www.guydavis.ca/projects/oss/tags

It is a javascript tree, one of a few javascript tags I use.

Davide Caruso wrote:

Hi,
i've to insert a treeview structure in my application based from data that are coming 
from a db?
There are some tags that can be useful (except struts-layout )??
There are smarter solutions than use a treeview?
Best regards. 

Davide Caruso
[EMAIL PROTECTED]
2003-10-28
--
Victor Cekvenich,
Struts Instructor
(215) 321-9146
Advanced Struts Training
http://basebeans.com/do/cmsPg?content=TRAINING Server Side Java
training with Rich UI, mentoring, designs, samples and project recovery
in North East.
Simple best practice basic Portal, a Struts CMS, Membership, Forums,
Shopping and Credit processing, http://basicportal.com software, ready
to develop/customize; requires a db to run.


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


Re: wildcard matching support

2003-10-28 Thread Rhet Behler
So let me get this correct..

validwhen only does a server side check?


- Original Message - 
From: Vic Cekvenich [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, October 28, 2003 10:57 AM
Subject: Re: wildcard matching support


 I think nightly build (Struts 1.2) has it.
 .V

 Sonam Belbase wrote:
  Hi,
 
  I am looking to use Wildcard matching support for my action mappings.
  I am currently using Struts 1.1 .
  This feature does not seem to be supported in the build I have .
 
  If any one has used the WildCardMatching support in struts ,I would like
 
  to know the release build to use to pick up these classes.
 
  Any information would be extremely useful.
 
  Thanks.
 
  SB
 
  --
  NOTICE: If received in error, please destroy and notify sender.  Sender
  does not waive confidentiality or privilege, and use is prohibited.

 -- 
 Victor Cekvenich,
 Struts Instructor
 (215) 321-9146

 Advanced Struts Training
 http://basebeans.com/do/cmsPg?content=TRAINING Server Side Java
 training with Rich UI, mentoring, designs, samples and project recovery
 in North East.
 Simple best practice basic Portal, a Struts CMS, Membership, Forums,
 Shopping and Credit processing, http://basicportal.com software, ready
 to develop/customize; requires a db to run.



 -
 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: Pass XML fragment to tile?

2003-10-28 Thread Ruth, Brice
no, is this what I should be doing? Do I have to do anything special in 
my tile to bring contextNode into scope? I've been using

c:set var=varNametiles:getAsString name=varName//c:set

for all the other parameters I pass into the tile ...

Kris Schneider wrote:

Are you doing something like:

x:forEach var=node select=$xml//catalog
 tiles:insert ...
   tiles:put beanName=node name=contextNode/
 /tiles:insert
/x:forEach
And then in your tile using contextNode:

x:forEach select=$contextNode/family
 ...
Quoting Ruth, Brice [EMAIL PROTECTED]:

 

I'm not having a problem using the proper attributes within the foreach, 
I'm having a problem passing an XML fragment to my Tile. I need to be 
able to pass

family order=1key1/family
family order=2key2/family
...
to the Tile - and that's not happening, as far as I can tell. Within the 
foreach I'm doing a few different things, pulling out nameKey, and 
various other attributes and such - and that's all fine, its actually 
getting the entire node that is the current node and passing that to 
the Tile that seems to be troublesome.

So, my XML for a particular category looks like this:

   category order=8 nameKey=nav.crafts.webcat.trimmers
   family order=1nav.crafts.prdctfm.prsnlppr/family
   family order=2nav.crafts.prdctfm.rtry/family
   /category
So, with my x:forEach XPath statement, the context node is a category 
like this - and I can pull out @nameKey, @order, etc. - to my heart's 
content. I can also do an x:if on family to determine if any family 
nodes exist in the current context - this is all OK.

However, there's processing that the tile I include in my x:forEach 
needs to do that needs this XML fragment (specifically, it needs to loop 
through each family and do something specific, much in the same way that 
the parent is looping through each category and doing something 
specific). So, I need to pass XML like that above, from the current 
context to the Tile ... somehow.

Is this possible?

Kris Schneider wrote:

   

That's fine, isn't it? It should just be the string representation of the
context node (i.e. nodeclass.toString()). What if you do:
x:forEach select=$xml//catalog
nameKey: x:out select=@nameKey/
/x:forEach
Quoting Ruth, Brice [EMAIL PROTECTED]:



 

Hrmpf, not working they way I expected.

When I add var=node to my x:forEach, and then use c:out 
value=${node}/ to display the contents (as this is what would be 
passed to the Tile, via tiles:put) - I get the following:

[category: null]

The XPath statement I am using as my select for the forEach, has as its 
last node, category ... what I would hope to get is either something 
like this:

category order=3 nameKey=nav.section.whatever
  family order=1whatever/family
  ...
/category
-OR- just the list of family nodes.

Kris Schneider wrote:

  

   

I don't know much about Tiles, but x:forEach can explicitly export a


 

scoped
  

   

variable via its var attribute:

x:forEach var=node select=...

It also implicitly sets the context node each time through an iteration.
 

So,
   



 

I'm
  

   

assuming that another XPath expression within the tile would operate


 

realtive to
  

   

the context set by x:forEach. If you know Tiles and have some handy
 

test
   



 

XML
  

   

data, it shouldn't be too hard to test out either (or both) of those


 

approaches...
  

   

Quoting Ruth, Brice [EMAIL PROTECTED]:





 

I have an x:forEach loop (JSTL) that contains within it a tiles:insert
   

statement - and I'd like to pass the current node of XML to the tile for
   

additional processing (conditionally). Is this possible? Within the 
tile, I'll need to do an x:forEach loop on the passed in fragment, so I
   

believe I'll need to be able to use x:parse on the fragment that was 
passed in. I'm open to other ways of doing this, as well, but they need
   

to only involve what can be done within a JSP/tile, really. I'm 
extending an existing set of code, and am not really open to rewriting 
it all :)

--
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.
 

  

   



 

--
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.
  

   



 

--
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.
   

 

--
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.


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


Re: Pass XML fragment to tile?

2003-10-28 Thread Kris Schneider
Ah, well, here's where I'm out of my element. Perhaps (in the tile):

tiles:importAttribute name=contextNode/
x:forEach select=$contextNode/family
...

Quoting Ruth, Brice [EMAIL PROTECTED]:

 no, is this what I should be doing? Do I have to do anything special in 
 my tile to bring contextNode into scope? I've been using
 
 c:set var=varNametiles:getAsString name=varName//c:set
 
 for all the other parameters I pass into the tile ...
 
 Kris Schneider wrote:
 
 Are you doing something like:
 
 x:forEach var=node select=$xml//catalog
   tiles:insert ...
 tiles:put beanName=node name=contextNode/
   /tiles:insert
 /x:forEach
 
 And then in your tile using contextNode:
 
 x:forEach select=$contextNode/family
   ...
 
 Quoting Ruth, Brice [EMAIL PROTECTED]:
 
   
 
 I'm not having a problem using the proper attributes within the foreach, 
 I'm having a problem passing an XML fragment to my Tile. I need to be 
 able to pass
 
 family order=1key1/family
 family order=2key2/family
 ...
 
 to the Tile - and that's not happening, as far as I can tell. Within the 
 foreach I'm doing a few different things, pulling out nameKey, and 
 various other attributes and such - and that's all fine, its actually 
 getting the entire node that is the current node and passing that to 
 the Tile that seems to be troublesome.
 
 So, my XML for a particular category looks like this:
 
 category order=8 nameKey=nav.crafts.webcat.trimmers
 family order=1nav.crafts.prdctfm.prsnlppr/family
 family order=2nav.crafts.prdctfm.rtry/family
 /category
 
 So, with my x:forEach XPath statement, the context node is a category 
 like this - and I can pull out @nameKey, @order, etc. - to my heart's 
 content. I can also do an x:if on family to determine if any family 
 nodes exist in the current context - this is all OK.
 
 However, there's processing that the tile I include in my x:forEach 
 needs to do that needs this XML fragment (specifically, it needs to loop 
 through each family and do something specific, much in the same way that 
 the parent is looping through each category and doing something 
 specific). So, I need to pass XML like that above, from the current 
 context to the Tile ... somehow.
 
 Is this possible?
 
 Kris Schneider wrote:
 
 
 
 That's fine, isn't it? It should just be the string representation of
 the
 context node (i.e. nodeclass.toString()). What if you do:
 
 x:forEach select=$xml//catalog
  nameKey: x:out select=@nameKey/
 /x:forEach
 
 Quoting Ruth, Brice [EMAIL PROTECTED]:
 
  
 
   
 
 Hrmpf, not working they way I expected.
 
 When I add var=node to my x:forEach, and then use c:out 
 value=${node}/ to display the contents (as this is what would be 
 passed to the Tile, via tiles:put) - I get the following:
 
 [category: null]
 
 The XPath statement I am using as my select for the forEach, has as its
 
 last node, category ... what I would hope to get is either something 
 like this:
 
 category order=3 nameKey=nav.section.whatever
family order=1whatever/family
...
 /category
 
 -OR- just the list of family nodes.
 
 Kris Schneider wrote:
 

 
 
 
 I don't know much about Tiles, but x:forEach can explicitly export a
  
 
   
 
 scoped

 
 
 
 variable via its var attribute:
 
 x:forEach var=node select=...
 
 It also implicitly sets the context node each time through an
 iteration.
   
 
 So,
 
 
  
 
   
 
 I'm

 
 
 
 assuming that another XPath expression within the tile would operate
  
 
   
 
 realtive to

 
 
 
 the context set by x:forEach. If you know Tiles and have some handy
   
 
 test
 
 
  
 
   
 
 XML

 
 
 
 data, it shouldn't be too hard to test out either (or both) of those
  
 
   
 
 approaches...

 
 
 
 Quoting Ruth, Brice [EMAIL PROTECTED]:
 
 
 
  
 
   
 
 I have an x:forEach loop (JSTL) that contains within it a
 tiles:insert
 
 
 statement - and I'd like to pass the current node of XML to the tile
 for
 
 
 additional processing (conditionally). Is this possible? Within the 
 tile, I'll need to do an x:forEach loop on the passed in fragment, so
 I
 
 
 believe I'll need to be able to use x:parse on the fragment that was 
 passed in. I'm open to other ways of doing this, as well, but they
 need
 
 
 to only involve what can be done within a JSP/tile, really. I'm 
 extending an existing set of code, and am not really open to rewriting
 
 it all :)
 
 -- 
 Brice D. Ruth
 Sr. IT Analyst
 Fiskars Brands, Inc.
   
 

 
 
 
  
 
   
 
 -- 
 Brice D. Ruth
 Sr. IT Analyst
 Fiskars Brands, Inc.

 
 
 
  
 
   
 
 -- 
 Brice D. Ruth
 Sr. IT Analyst
 Fiskars Brands, Inc.
 
 
 
   
 
 
 -- 
 Brice D. Ruth
 Sr. IT Analyst
 Fiskars Brands, Inc.

-- 
Kris 

Re: AW: bye thank you

2003-10-28 Thread Joe Germuska
Would this be what you had in mind?

http://nagoya.apache.org/wiki/apachewiki.cgi?StrutsProjectPages

On Oct 28, 2003, at 2:47 AM, Frédéric Dreier wrote:

I don't know, but perhaps there exists some wiki-style repository for
struts? Or perhaps it would be time to organise one...


-Ursprüngliche Nachricht-
Von: David Thielen [mailto:[EMAIL PROTECTED]
Gesendet: Dienstag, 28. Oktober 2003 02:36
An: Struts-Users
Betreff: bye  thank you
Hi;

I'm leaving the list but I wanted to say thank you to all that helped.

And a plea to one of the struts experts - the world desperately needs a
struts cookbook. ie, if you want to do X, here is how. The top 40 or 
50 of
those items would be wonderful (and cut down on traffic a lot).

thanks - dave

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

--
Joe Germuska
[EMAIL PROTECTED]
http://blog.germuska.com
 We want beef in dessert if we can get it there.
  -- Betty Hogan, Director of New Product Development, National 
Cattlemen's Beef Association



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


RE: Forward Cannot Be Achieved In One Step

2003-10-28 Thread Caroline Jen
Thanks for the reply.  Now, I understand that I have
two actions.  However, I do quite understand what you
suggested.  You said:

u can also use 
html:link action=/Logofflogoff/html:link
where logoff is ur global forward.
html:link forward=/Logofflogoff/html:link

I still have two actions if I use 
html:link action=/do/Logofflogoff/html:link

because I have

action 
   path=/Logoff
   type=org.NameOfOrganization.signoff.LogoffAction
 forward
name=success
path=/do/Menu/
/action
 
In the LogoffAction.java, I invalidate the session
and I want the user to go back the welcome page.  And

action
  path=/Menu
  name=menuForm
type=org.apache.struts.scaffold.ExistsAttributeAction
  parameter=application;HOURS
 forward
name=success
path=.article.Menu/
 forward
name=failure
path=/do/MenuCreate/
 
The .article.Menu is my tile that displays the welcome
page.



--- [EMAIL PROTECTED] wrote:
 u can also use 
 html:link action=/Logofflogoff/html:link
 where logoff is ur global forward.
 html:link forward=/Logofflogoff/html:link
 hence it wont be a 2 step stuff but directly calling
 ur Action class which does cleanup work for the log
 off process as session cleaning up and invalidating
 the other objects (probably signing off the user),
 And forwards later on to one of the jsp's 
 U can create a global forward for the same too which
 represents an action.
 I guess its only available in 1.1 version of Struts.
 
 
 -Original Message-
 From: Caroline Jen [mailto:[EMAIL PROTECTED]
 Sent: 28 October 2003 17:05
 To: Struts Users Mailing List
 Subject: Re: Forward Cannot Be Achieved In One Step
 
 
 The do/Menu does display my welcome page.  The
 LOGOUT button and forward does eventually lead the
 visitor to the welcome page.  The problem is that it
 takes two steps intead of going straight to the
 welcome page.  Let me re-state my problem:
 
 I have the following code in the navbarMenu.jsp:
 
 html:link forward=exitLOGOUT/html:link
 
 and in the struts-config.xml, I have:
 
 forward
name=exit
path=/do/Logoff/
 
 and 
 
 action 
path=/Logoff
   
 type=org.NameOfOrganization.signoff.LogoffAction
  forward
  name=success
  path=/do/Menu/
 /action
 
 In the LogoffAction.java, I invalidate the session
 and
 I want the user to go back the welcome page.  And 
 
 action
   path=/Menu
   name=menuForm
 

type=org.apache.struts.scaffold.ExistsAttributeAction
   parameter=application;HOURS
 forward
name=success
path=.article.Menu/
 forward
name=failure
path=/do/MenuCreate/
 
 The .article.Menu is my tile that displays the
 welcome
 page.
 
 The problem is that it takes two steps for the user
 to
 go back to the welcome page - After the first click,
 the same screen remains in the browser.  The only
 change is what is shown in the address bar.  I have
 to
 click the LOGOFF button again and then the welcome
 page is displayed.  
 
 What should I do to go back to the welcome page in
 one
 step?
 
 --- Ruth, Brice [EMAIL PROTECTED] wrote:
  Is your Menu actionforward the welcome screen
 you
  want to get to? And 
  does your Action return an ActionForward to this?
  
  Caroline Jen wrote:
  
  Hi, I have the following code in the
  navbarMenu.jsp:
  
  html:link forward=exitLOGOUT/html:link
  
  and in the struts-config.xml, I have:
  
  forward
 name=exit
 path=/do/Logoff/
  
  and 
  
  action 
 path=/Logoff

 
 type=org.NameOfOrganization.signoff.LogoffAction
   forward
   name=success
   path=/do/Menu/
  /action
  
  In the LogoffAction.java, I invalidate the
 session
  and
  I want the user to go back the welcome page.
  
  The problem is that it takes two steps for the
 user
  to
  go back to the welcome page - After the first
  click,
  the same screen remains in the browser.  The only
  change is what is shown in the address bar.  I
 have
  to
  click the LOGOFF button again and then the
 welcome
  page is displayed.  
  
  What should I do to go back to the welcome page
 in
  one step?
  
  __
  Do you Yahoo!?
  Exclusive Video Premiere - Britney Spears
  http://launch.yahoo.com/promos/britneyspears/
  
 

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

  
  
  -- 
  Brice D. Ruth
  Sr. IT Analyst
  Fiskars Brands, Inc.
  
  
  
 

-
  To unsubscribe, e-mail:
  [EMAIL PROTECTED]
  For additional commands, e-mail:
  [EMAIL PROTECTED]
  
 
 
 __
 Do you Yahoo!?
 The New Yahoo! Shopping - with improved product
 search
 http://shopping.yahoo.com
 

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

Re: Pass XML fragment to tile?

2003-10-28 Thread Ruth, Brice
I think we're in business. SWEET!! Thanks.

Kris Schneider wrote:

Ah, well, here's where I'm out of my element. Perhaps (in the tile):

tiles:importAttribute name=contextNode/
x:forEach select=$contextNode/family
...
Quoting Ruth, Brice [EMAIL PROTECTED]:

 

no, is this what I should be doing? Do I have to do anything special in 
my tile to bring contextNode into scope? I've been using

c:set var=varNametiles:getAsString name=varName//c:set

for all the other parameters I pass into the tile ...

Kris Schneider wrote:

   

Are you doing something like:

x:forEach var=node select=$xml//catalog
tiles:insert ...
  tiles:put beanName=node name=contextNode/
/tiles:insert
/x:forEach
And then in your tile using contextNode:

x:forEach select=$contextNode/family
...
Quoting Ruth, Brice [EMAIL PROTECTED]:



 

I'm not having a problem using the proper attributes within the foreach, 
I'm having a problem passing an XML fragment to my Tile. I need to be 
able to pass

family order=1key1/family
family order=2key2/family
...
to the Tile - and that's not happening, as far as I can tell. Within the 
foreach I'm doing a few different things, pulling out nameKey, and 
various other attributes and such - and that's all fine, its actually 
getting the entire node that is the current node and passing that to 
the Tile that seems to be troublesome.

So, my XML for a particular category looks like this:

  category order=8 nameKey=nav.crafts.webcat.trimmers
  family order=1nav.crafts.prdctfm.prsnlppr/family
  family order=2nav.crafts.prdctfm.rtry/family
  /category
So, with my x:forEach XPath statement, the context node is a category 
like this - and I can pull out @nameKey, @order, etc. - to my heart's 
content. I can also do an x:if on family to determine if any family 
nodes exist in the current context - this is all OK.

However, there's processing that the tile I include in my x:forEach 
needs to do that needs this XML fragment (specifically, it needs to loop 
through each family and do something specific, much in the same way that 
the parent is looping through each category and doing something 
specific). So, I need to pass XML like that above, from the current 
context to the Tile ... somehow.

Is this possible?

Kris Schneider wrote:

  

   

That's fine, isn't it? It should just be the string representation of
 

the
   

context node (i.e. nodeclass.toString()). What if you do:

x:forEach select=$xml//catalog
nameKey: x:out select=@nameKey/
/x:forEach
Quoting Ruth, Brice [EMAIL PROTECTED]:





 

Hrmpf, not working they way I expected.

When I add var=node to my x:forEach, and then use c:out 
value=${node}/ to display the contents (as this is what would be 
passed to the Tile, via tiles:put) - I get the following:

[category: null]

The XPath statement I am using as my select for the forEach, has as its
   

last node, category ... what I would hope to get is either something 
like this:

category order=3 nameKey=nav.section.whatever
 family order=1whatever/family
 ...
/category
-OR- just the list of family nodes.

Kris Schneider wrote:

 

  

   

I don't know much about Tiles, but x:forEach can explicitly export a
   



 

scoped
 

  

   

variable via its var attribute:

x:forEach var=node select=...

It also implicitly sets the context node each time through an
 

iteration.
   



 

So,
  

   

   



 

I'm
 

  

   

assuming that another XPath expression within the tile would operate
   



 

realtive to
 

  

   

the context set by x:forEach. If you know Tiles and have some handy


 

test
  

   

   



 

XML
 

  

   

data, it shouldn't be too hard to test out either (or both) of those
   



 

approaches...
 

  

   

Quoting Ruth, Brice [EMAIL PROTECTED]:



   



 

I have an x:forEach loop (JSTL) that contains within it a
   

tiles:insert
   

  

statement - and I'd like to pass the current node of XML to the tile
   

for
   

  

additional processing (conditionally). Is this possible? Within the 
tile, I'll need to do an x:forEach loop on the passed in fragment, so
   

I
   

  

believe I'll need to be able to use x:parse on the fragment that was 
passed in. I'm open to other ways of doing this, as well, but they
   

need
   

  

to only involve what can be done within a JSP/tile, really. I'm 
extending an existing set of code, and am not really open to rewriting
   

it all :)

--
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.
 

  

   

   



 

--
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.
 

  

 

[OT] Next Struts-Atlanta meeting

2003-10-28 Thread James Mitchell
For anyone interested our next meeting is this week.

(don't forget about the 6:30 drinks and discussion 
 before the presentation at MaxErma's)


When  - This Thursday from 7PM to 9PM
Where - Mirant
Presenter - Bill Siggelkow
Topic - Testing Struts Applications


For more details and a map to Mirant point your 
browser to http://www.struts-atlanta.org/


--
James Mitchell
Software Engineer / Struts Evangelist
http://www.struts-atlanta.org
678.910.8017
770.822.3359
AIM:jmitchtx


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



Re: Problem with UTF-8 characters in a mutlipart/form-data encoded form

2003-10-28 Thread Paul Barry
I think the the problem is that the browser is not encoding the text field in UTF-8.  Supposedly setting the 
accept-charset attribute of the HTML form tag to UTF-8 will make it encode the field in UTF-8.  Unfortunately, there is 
no accept-charset property of the html:form strugs tag, although there is a request for one to be added:

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21986

And on top of that, the accept-charset doesn't seems to work for me anyway when I try it outside of the html:form tag. 
For example, if I make an HTML form like this:

  form action=testForm.do enctype=multipart/form-data method=post 
accept-charset=UTF-8
input type=text name=test /
input type=submit /
  /form
If I use ethereal to capture the HTTP request as it received by the server (before it ever gets to the actual servlet 
container) the cahacters don't show up correctly.  For example, the single charater  turns into the two characters .

But, interestingly enough, using IE if I have View  Encoding set to Auto-Select, it does encode the data in UTF-8 and 
when it gets to my struts action, I correctly have a .  But, if I uncheck View  Encoding  Auto-Select, even though 
just below that View  Encoding  Unicode (UTF-8) is selected, the data then doesn't get encoding correctly and I end up 
with .  So it sounds like this isn't really a struts problem and more a browser problem, but how do I get the browser 
to encode the data in UTF-8?  I am doing something wrong with accept-charset?

Jos Gustavo Zagato wrote:

I have doubts on it also... 
The only thing that I'm doing at the front end is to set the encode to
utf-8 I will double check it..

Regards...

  Jos Gustavo Zagato Rosa
System Analyst - Atos Origin
[EMAIL PROTECTED]
-Original Message-
From: Paul Barry [mailto:[EMAIL PROTECTED] 
Sent: tera-feira, 28 de outubro de 2003 12:26
To: Struts Users Mailing List
Subject: Re: Problem with UTF-8 characters in a mutlipart/form-data
encoded form

Does it work with multipart/form-data encoding?  It seems to me that
this problem is happening before the form is 
submitted to the servlet container (take a look at the value of test
in the HTTP request with Content-Type: 
multipart/form-data in my original post), so the servlet filter wouldn't
help, but I could be wrong.

Jos Gustavo Zagato wrote:


Hi !

I don't if it will fit into your needs but, to handler UTF-8 I
build a serverlet filter with handles all encode / Decode operations.
As

far as I know this approach is not a pure Struts solution but works
really fine !
I didn't test with a upload form like yours, but its a shot !
Regards

 Jos Gustavo Zagato Rosa
System Analyst - Atos Origin
[EMAIL PROTECTED]
-Original Message-
From: Paul Barry [mailto:[EMAIL PROTECTED] 
Sent: tera-feira, 28 de outubro de 2003 12:07
To: [EMAIL PROTECTED]
Subject: Problem with UTF-8 characters in a mutlipart/form-data
encoded

form

I am using Struts 1.1 in an application that needs to support the
UTF-8

character set.  I am using Resin 2.1.10 with 
character-encoding=UTF-8, and on most of my forms this seems to work
just fine.  I am having problems with forms that 
have to use the multipart/form-data enctype for handling uploading
files.  If I print out the value of a text element in 
an html:form where the enctype is not set at all (which ends up using
application/x-www-form-urlencoded), using UTF-8 
characters works fine.  This is what I get:

INFO - test.TestAction - The value is: 

Here is what the actual HTTP request that gets sent to the server
looks

like:

--- Start HTTP Request
-
POST /testForm.do HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
application/x-shockwave-flash, */*
Referer: http://pbdesktop/test.do
Accept-Language: en-us
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
Host: pbdesktop
Content-Length: 11
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: SERVER=op; locale=en_US; JSESSIONID=aoUCARQpqsLd
test=%C3%AD
--- End HTTP Request
--
But if I modify my html:form to use enctype=multipart/form-data, I
get

this:

INFO - test.TestAction - The value is: A

And the HTTP request looks like this:

--- Start HTTP Request
-
POST /testForm.do HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
application/x-shockwave-flash, */*
Referer: http://pbdesktop/test.do
Accept-Language: en-us
Content-Type: multipart/form-data;
boundary=---7d319628600e4
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
Host: pbdesktop
Content-Length: 141
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: SERVER=op; locale=en_US; JSESSIONID=aoUCARQpqsLd
-7d319628600e4

RE: Struts-config

2003-10-28 Thread Edgar P Dollin
Very cool, exactly what I was looking for.

Edgar

-Original Message-
From: Kris Schneider [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 28, 2003 8:22 AM
To: Struts Users Mailing List
Subject: RE: Struts-config


Or, if you're using Ant, try the optional xmlvalidate task (this is almost
exactly one of the examples given):

xmlvalidate file=struts-config.xml
  dtd publicId=-//Apache Software Foundation//DTD Struts Configuration
1.1//EN
   location=struts-config_1_1.dtd/
/xmlvalidate

http://ant.apache.org/manual/OptionalTasks/xmlvalidate.html

Quoting Matt Raible [EMAIL PROTECTED]:

 Download XML Spy (or another good XML tool) and validate it against the
 DTD.
 
 -Original Message-
 From: Edgar P Dollin [mailto:[EMAIL PROTECTED]
 Sent: Monday, October 27, 2003 4:37 PM
 To: Struts Users Mailing List
 Subject: Struts-config
 
 
 Has anyone experienced situtation where struts 1.1 will not allow any
 configuration items (controller / message-resources / plug-in) after the
 end
 of the action-mappings section.
 
 The error message is
 
   xml.sax.SAXParseException: Element struts-config allows no further
 input; controller is not allowed.
 
 I have checked the DTD and the position for these elements should follow
 action-mappings yet something is upsetting the digester.  I have double
 checked the syntax and made sure it is correct.
 
 If anyone has an insight, thanks in advance
 
 Edgar

-- 
Kris Schneider mailto:[EMAIL PROTECTED]
D.O.Tech   http://www.dotech.com/

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



dynamic drop-down changes without calling action class using session

2003-10-28 Thread Kaja.Mohideen
Hi,
   I am having trouble when I try to use struts and Javascript together. =
I am using 4 dropdown list. Based on one selection dynamically change =
other drop- down list. Eventhough I am bringing all drop-list from DB at =
one time and stored in session. I would like to know how to synchronize =
without calling action class again.=20

   In advance I appreciate your help..

Thanks,
Kaja



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



Re: dynamic drop-down changes without calling action class using session

2003-10-28 Thread Ruth, Brice
You'll have to do more than store the data for your drop-down in the 
session, if you don't want another request to go to the server - you'll 
have to store all the data for your drop-downs in JavaScript and use 
JavaScript to dynamically populate the drop-downs as selections change.

[EMAIL PROTECTED] wrote:

Hi,
  I am having trouble when I try to use struts and Javascript together. =
I am using 4 dropdown list. Based on one selection dynamically change =
other drop- down list. Eventhough I am bringing all drop-list from DB at =
one time and stored in session. I would like to know how to synchronize =
without calling action class again.=20
  In advance I appreciate your help..

Thanks,
Kaja


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

--
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.


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


Re: Dynamic Text Boxes - Urgent .Pl help - Struts

2003-10-28 Thread Ted Husted
You can define an Array to catch multiple parameters of the same name.

http://husted.com/struts/tips/006.html

HTH, Ted.

[name withheld] wrote:
Hi Husted,
 
 
I Have  a Struts  jsp with with  some Dynamic text boxes.  I have 
array list that contain  data for these text boxes.I put this List in 
the request object in the action class.
 Here The problem is all text boxes names are same.
 
Example java code.
For (i=0;ilist.size ;i++)
{
input type =text name = chargeCode value =list.code 
}
 
Actually I am doing this one by struts and Jstl for each.
Here Text field name is same for all. How Can I create those many 
setter/Getter methods without knowing.
Please let me know How to handle this with Jsp - form bean.
 
I really appriciate your help.
 
Thanks,


--
Ted Husted,
  Junit in Action  - http://www.manning.com/massol/,
  Struts in Action - http://husted.com/struts/book.html,
  JSP Site Design  - http://www.amazon.com/exec/obidos/ISBN=1861005512.


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


Re: Sell me on tiles revisited

2003-10-28 Thread Ted Husted
Sounds like a job for the Struts Wiki!

http://nagoya.apache.org/wiki/apachewiki.cgi?StrutsProjectPages

Frank Rizzo wrote:

Why should we use tiles as opposed to anything else? I am told that this question comes often, so the list below has been compiled from this mailing list archive and other published articles to consolidate the arguments for using tiles.  If you have experience with tiles, please add, modify, or subtract from this list with the goal of creating a list that people can use when evaluating whether to use tiles or not on their project. 
 
1) Inheritence. Why don't we just use the jsp:include/ tag or @include to include common page elements? tiles definitions support inheritence. If you have 60 jsps, you have @include header.jsp repeated in every jsp. Next, imagine a new requirement dictates that the menu should be moved from the right side to the left. You now have to change 60 jsps.  If your application uses tiles, you change only one jsp, all of your jsps inherit from this layout jsp. 
 
2) If you have a standard site with a common layout (header, footer, menu, bodycontent), tiles does what you want to do very cleanly, integrates with Struts very nicely, and is a standard solution that you don't have to develop or document, and that your team members may already have experience with or at least be more excited about learning than an in-house, one-off system since that experience will have more value in the marketplace.
 
3) Using jsp:include or @ include you cannot internationalize parameterized content very easily.
 
4) Tiles-defs.xml offers a central document to determine which jsps are used in which places. If the developers follow mvc properly, a new person new to the project can get a sense of site flow and structure by looking at only struts-config.xml and tiles-defs.xml
 
5) You can use a tiles controller rather than write a custom tag. This is especially useful for creating a tile such as Amazon's books you've recently browsed. The tile can plug in to any page without considering the Struts action code for that URL.
 
6) Tiles scope offers another namespace where attribute names will not collide.



-
Do you Yahoo!?
Exclusive Video Premiere - Britney Spears
--
Ted Husted,
  Junit in Action  - http://www.manning.com/massol/,
  Struts in Action - http://husted.com/struts/book.html,
  JSP Site Design  - http://www.amazon.com/exec/obidos/ISBN=1861005512.


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


RE: dynamic drop-down changes without calling action class using session

2003-10-28 Thread Kaja.Mohideen
Thanks, 

  But, Right now I am using the following way with javascript,

   eg. First drop down,
html:select property=system style=width:150px onchange=return 
call(this) styleId='sys1' styleClass=text
   html:options collection=systemids1 property=value 
labelProperty=label/
/html:select

  Second drop-down,
html:select property=subsystem style=width:150px;display:'none' 
onchange=pops(this) styleId='subsys1' styleClass=text 
  html:options collection=subsystemids1 property=value 
labelProperty=label/ /html:select

 html:select property=subsystem style=width:150px;display:'none' 
onchange=pops(this) styleId='subsys2' styleClass=text 
  html:options collection=subsystemids2 property=value 
labelProperty=label/ /html:select

Depends on first drop-down selection i am hiding subsystem1 or subsystem2. If 
suppose the first drop-down has lengthy list then my logic needs more drop-downs. It 
increase the code side and maintenance..Is there any way to do that?..

Thanks,
Kaja

-Original Message-
From: Ruth, Brice [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 28, 2003 4:19 PM
To: Struts Users Mailing List
Subject: Re: dynamic drop-down changes without calling action class
using session


You'll have to do more than store the data for your drop-down in the 
session, if you don't want another request to go to the server - you'll 
have to store all the data for your drop-downs in JavaScript and use 
JavaScript to dynamically populate the drop-downs as selections change.

[EMAIL PROTECTED] wrote:

Hi,
   I am having trouble when I try to use struts and Javascript together. =
I am using 4 dropdown list. Based on one selection dynamically change =
other drop- down list. Eventhough I am bringing all drop-list from DB at =
one time and stored in session. I would like to know how to synchronize =
without calling action class again.=20

   In advance I appreciate your help..

Thanks,
Kaja



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

  


-- 
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.



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



DB problem

2003-10-28 Thread Rajat Pandit
Hello all,
I have an application which does an extensive db related work, a huge
number of queries before it can commit the informsation back to the db.
I have app running just fine on my local machine but when I hosted it on
a similar config server I got this error.

java.lang.StackOverflowError
at java.net.SocketInputStream.read(SocketInputStream.java:114)
at
java.io.BufferedInputStream.fill(BufferedInputStream.java:183)
at
java.io.BufferedInputStream.read(BufferedInputStream.java:201)
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:1309)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1624)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:889)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:956)
at com.mysql.jdbc.MysqlIO.sqlQuery(MysqlIO.java:928)
at com.mysql.jdbc.Connection.execSQL(Connection.java:1871)
at com.mysql.jdbc.Connection.execSQL(Connection.java:1805)
at com.mysql.jdbc.Statement.executeQuery(Statement.java:1143)
at com.hedging.Bid.factors(Bid.java:364)
at com.hedging.Bid.getT(Bid.java:150)
at com.hedging.Bid.getT(Bid.java:166)

Can someone explain why I got this and how to fix it.
Thanks.




Rajat Pandit | [EMAIL PROTECTED]
+91 612 3117606
[ Developer and Part Time Human Being]


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



Session Timeout on post

2003-10-28 Thread Srinivas Gunturu
Is there a recommended way of handling session timeouts?  Especially when a user fills 
out a form and submits after session has timedout.

Using Tomcat realm is the preferred/recommended way or is there any other alternative 
in Struts?

TIA


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



RE: Forward Cannot Be Achieved In One Step

2003-10-28 Thread Caroline Jen
Let me re-phrase my question.

Upon the user click on the LOGOUT buttion, I have two
actions - the first one of the actions is Logoff.java
in which I invalidate the session, ..., etc. and the
second action upon success will lead the user to the
welcome page in which choices for unregistered member
plus a LOGON buttion is provided.
 
As long as two actions are involved, the user does not
get back to the welcome page by just click on the
LOGOFF button only once. 

Need your guidance on how such a situation is usually
handled? 


--- Caroline Jen [EMAIL PROTECTED] wrote:
 Thanks for the reply.  Now, I understand that I have
 two actions.  However, I do quite understand what
 you
 suggested.  You said:
 
 u can also use 
 html:link action=/Logofflogoff/html:link
 where logoff is ur global forward.
 html:link forward=/Logofflogoff/html:link
 
 I still have two actions if I use 
 html:link action=/do/Logofflogoff/html:link
 
 because I have
 
 action 
path=/Logoff
   
 type=org.NameOfOrganization.signoff.LogoffAction
  forward
 name=success
 path=/do/Menu/
 /action
  
 In the LogoffAction.java, I invalidate the session
 and I want the user to go back the welcome page. 
 And
 
 action
   path=/Menu
   name=menuForm

type=org.apache.struts.scaffold.ExistsAttributeAction
   parameter=application;HOURS
  forward
 name=success
 path=.article.Menu/
  forward
 name=failure
 path=/do/MenuCreate/
  
 The .article.Menu is my tile that displays the
 welcome
 page.
 
 
 
 --- [EMAIL PROTECTED] wrote:
  u can also use 
  html:link action=/Logofflogoff/html:link
  where logoff is ur global forward.
  html:link forward=/Logofflogoff/html:link
  hence it wont be a 2 step stuff but directly
 calling
  ur Action class which does cleanup work for the
 log
  off process as session cleaning up and
 invalidating
  the other objects (probably signing off the user),
  And forwards later on to one of the jsp's 
  U can create a global forward for the same too
 which
  represents an action.
  I guess its only available in 1.1 version of
 Struts.
  
  
  -Original Message-
  From: Caroline Jen [mailto:[EMAIL PROTECTED]
  Sent: 28 October 2003 17:05
  To: Struts Users Mailing List
  Subject: Re: Forward Cannot Be Achieved In One
 Step
  
  
  The do/Menu does display my welcome page.  The
  LOGOUT button and forward does eventually lead
 the
  visitor to the welcome page.  The problem is that
 it
  takes two steps intead of going straight to the
  welcome page.  Let me re-state my problem:
  
  I have the following code in the navbarMenu.jsp:
  
  html:link forward=exitLOGOUT/html:link
  
  and in the struts-config.xml, I have:
  
  forward
 name=exit
 path=/do/Logoff/
  
  and 
  
  action 
 path=/Logoff

 
 type=org.NameOfOrganization.signoff.LogoffAction
   forward
   name=success
   path=/do/Menu/
  /action
  
  In the LogoffAction.java, I invalidate the session
  and
  I want the user to go back the welcome page.  And 
  
  action
path=/Menu
name=menuForm
  
 

type=org.apache.struts.scaffold.ExistsAttributeAction
parameter=application;HOURS
  forward
 name=success
 path=.article.Menu/
  forward
 name=failure
 path=/do/MenuCreate/
  
  The .article.Menu is my tile that displays the
  welcome
  page.
  
  The problem is that it takes two steps for the
 user
  to
  go back to the welcome page - After the first
 click,
  the same screen remains in the browser.  The only
  change is what is shown in the address bar.  I
 have
  to
  click the LOGOFF button again and then the
 welcome
  page is displayed.  
  
  What should I do to go back to the welcome page in
  one
  step?
  
  --- Ruth, Brice [EMAIL PROTECTED] wrote:
   Is your Menu actionforward the welcome screen
  you
   want to get to? And 
   does your Action return an ActionForward to
 this?
   
   Caroline Jen wrote:
   
   Hi, I have the following code in the
   navbarMenu.jsp:
   
   html:link forward=exitLOGOUT/html:link
   
   and in the struts-config.xml, I have:
   
   forward
  name=exit
  path=/do/Logoff/
   
   and 
   
   action 
  path=/Logoff
 
  
 
 type=org.NameOfOrganization.signoff.LogoffAction
forward
name=success
path=/do/Menu/
   /action
   
   In the LogoffAction.java, I invalidate the
  session
   and
   I want the user to go back the welcome page.
   
   The problem is that it takes two steps for the
  user
   to
   go back to the welcome page - After the first
   click,
   the same screen remains in the browser.  The
 only
   change is what is shown in the address bar.  I
  have
   to
   click the LOGOFF button again and then the
  welcome
   page is displayed.  
   
   What should I do to go back to the welcome page
  in
   one step?
   
   __
   Do you Yahoo!?
 
=== message truncated ===



Action to Action

2003-10-28 Thread Barry Volpe
I have a form and an action that queries the
city when the state is provided. 

Now once I have the state and city I want to
call another action that displays information
associated with that state and city.  I am
going to have multiple views that require the
same state and city so  I wanted to keep the action that
queries the city separate from the action that queries
for the views.  Not sure how to go about doing this
in my struts-config.

I know I should not being doing so but since this
is a beginner app I have been performing the
queries inside my actions.

I get an error when trying to call one action
from another.

I have tried using JSTL to change the action path
on the fly but it is not consistent.

I may have to just perform the same query for 
the cities in all of my actions before I display the views.

Any suggestions, comments?

Thanks,
Barry

RE: Forward Cannot Be Achieved In One Step

2003-10-28 Thread David Friedman
I usually handle logoffs by having my logoff 
action invoke a jsp that does a
logic:redirect forward=forwardName/

With a forward setting having 'redirect=true'.
That forces the broswer to do a redirect and
reload the new page, allowing the URL to read
as the proper page.

Warning: with Struts v1.1 or earlier, this
will not work if you give it a forward listing
a tile instead of a JSP or action path.

Regards,
David

-Original Message-
From: Caroline Jen [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 28, 2003 4:51 PM
To: Struts Users Mailing List
Subject: RE: Forward Cannot Be Achieved In One Step


Let me re-phrase my question.

Upon the user click on the LOGOUT buttion, I have two
actions - the first one of the actions is Logoff.java
in which I invalidate the session, ..., etc. and the
second action upon success will lead the user to the
welcome page in which choices for unregistered member
plus a LOGON buttion is provided.
 
As long as two actions are involved, the user does not
get back to the welcome page by just click on the
LOGOFF button only once. 

Need your guidance on how such a situation is usually
handled? 


--- Caroline Jen [EMAIL PROTECTED] wrote:
 Thanks for the reply.  Now, I understand that I have
 two actions.  However, I do quite understand what
 you
 suggested.  You said:
 
 u can also use 
 html:link action=/Logofflogoff/html:link
 where logoff is ur global forward.
 html:link forward=/Logofflogoff/html:link
 
 I still have two actions if I use 
 html:link action=/do/Logofflogoff/html:link
 
 because I have
 
 action 
path=/Logoff
   
 type=org.NameOfOrganization.signoff.LogoffAction
  forward
 name=success
 path=/do/Menu/
 /action
  
 In the LogoffAction.java, I invalidate the session
 and I want the user to go back the welcome page. 
 And
 
 action
   path=/Menu
   name=menuForm

type=org.apache.struts.scaffold.ExistsAttributeAction
   parameter=application;HOURS
  forward
 name=success
 path=.article.Menu/
  forward
 name=failure
 path=/do/MenuCreate/
  
 The .article.Menu is my tile that displays the
 welcome
 page.
 
 
 
 --- [EMAIL PROTECTED] wrote:
  u can also use 
  html:link action=/Logofflogoff/html:link
  where logoff is ur global forward.
  html:link forward=/Logofflogoff/html:link
  hence it wont be a 2 step stuff but directly
 calling
  ur Action class which does cleanup work for the
 log
  off process as session cleaning up and
 invalidating
  the other objects (probably signing off the user),
  And forwards later on to one of the jsp's 
  U can create a global forward for the same too
 which
  represents an action.
  I guess its only available in 1.1 version of
 Struts.
  
  
  -Original Message-
  From: Caroline Jen [mailto:[EMAIL PROTECTED]
  Sent: 28 October 2003 17:05
  To: Struts Users Mailing List
  Subject: Re: Forward Cannot Be Achieved In One
 Step
  
  
  The do/Menu does display my welcome page.  The
  LOGOUT button and forward does eventually lead
 the
  visitor to the welcome page.  The problem is that
 it
  takes two steps intead of going straight to the
  welcome page.  Let me re-state my problem:
  
  I have the following code in the navbarMenu.jsp:
  
  html:link forward=exitLOGOUT/html:link
  
  and in the struts-config.xml, I have:
  
  forward
 name=exit
 path=/do/Logoff/
  
  and 
  
  action 
 path=/Logoff

 
 type=org.NameOfOrganization.signoff.LogoffAction
   forward
   name=success
   path=/do/Menu/
  /action
  
  In the LogoffAction.java, I invalidate the session
  and
  I want the user to go back the welcome page.  And 
  
  action
path=/Menu
name=menuForm
  
 

type=org.apache.struts.scaffold.ExistsAttributeAction
parameter=application;HOURS
  forward
 name=success
 path=.article.Menu/
  forward
 name=failure
 path=/do/MenuCreate/
  
  The .article.Menu is my tile that displays the
  welcome
  page.
  
  The problem is that it takes two steps for the
 user
  to
  go back to the welcome page - After the first
 click,
  the same screen remains in the browser.  The only
  change is what is shown in the address bar.  I
 have
  to
  click the LOGOFF button again and then the
 welcome
  page is displayed.  
  
  What should I do to go back to the welcome page in
  one
  step?
  
  --- Ruth, Brice [EMAIL PROTECTED] wrote:
   Is your Menu actionforward the welcome screen
  you
   want to get to? And 
   does your Action return an ActionForward to
 this?
   
   Caroline Jen wrote:
   
   Hi, I have the following code in the
   navbarMenu.jsp:
   
   html:link forward=exitLOGOUT/html:link
   
   and in the struts-config.xml, I have:
   
   forward
  name=exit
  path=/do/Logoff/
   
   and 
   
   action 
  path=/Logoff
 
  
 
 type=org.NameOfOrganization.signoff.LogoffAction
forward
name=success
path=/do/Menu/
   /action
   
   In the 

  1   2   >