RE: Help on struts

2004-03-26 Thread Shoaib
Thanks for your guidance.
You are right , we are in the case where user will come back from search
page.
I will try as you suggested and give feedback.
 
Regards
Shoaib
 
 
 
I guess the first thing to consider is what you mean by "come back to
the
previous page".
Do you just mean have the user redirected back to that url when they
have
finished playing with the search? or is it more complex. For example the
previous page is a form, and they are halfway through filling it in when
they need to search, and on completion need to take up where they left
off
with filling it in?
 
In the first case the easiest way (Im assuming there are multiple places
that send you to the search page) might be to have the link to the
search
page add a parameter to the url containing the name of an ActionForward
that
will take the user back to this page.
 
The search page can make note of this forward name, and when the user is
finished searching can look it up and return it as the forward from the
searchs action.
 
-Original Message-
From: Shoaib [mailto:[EMAIL   PROTECTED]
Sent: Saturday, 13 March 2004 14:01
To: 'Struts Users Mailing List'
Subject: Help on struts
 
 
We are using struts 1.1.
 
We have some pages where user is going to have some search icon and if
user clicks on that then he will move to search page where he can search
the value and then come back to the previous page.
 
Can somebody please give some idea how to do it.
 
Regards
Shoaib
 


Re: help with modules

2004-03-26 Thread James Norman
Try adding contextRelative="true" to the forwards in your
struts-config.  I remember a similar problem I had a while back, but I'm
not entirely sure this will solve it.  Here is an example of an Action I
had in a struts module I wrote:





-james
 
On Fri, 2004-03-26 at 10:08, Bruce Christie wrote:
> Hello,
> 
> I am playing around with modules and things work pretty nicely =
> except
> 
> I have a tiles template that reads in a menu.jsp from the default =
> WEB-INF.  The links to the actions are prepended with the module. (i.e. =
> . )
> 
> This works fine expect that once I am in the correct module the link =
> then points to  module1/module1/dosomething.do.  Is there a way that the =
> link tag can be used so that it will drop the module prefix when I am in =
> the module asscoiated with the action?
> 
> I think I read something about adding a module @ to the link tag but DTD =
> complains.
> 
> Thanks
> Bruce
> 
> -
> 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: HELP: applet-to-action anomaly

2004-03-23 Thread w i l l i a m b o y d
...this is how to reproduce the problem:

1) *FIRST* load http://www.thefreelancer.net:8080/soa/jsp/enterAreaToRead.do?
areaid=3. you should be taken to the error page.

2) then, load http://www.thefreelancer.net:8080/soa/jsp/mockups/index.jsp. 
you can see that the user is "logged in" by the message at the very bottom 
of the page.

3) then click on the "Standard Area Page" node of the navigation applet on 
the left-hand side of the page. if you've done the steps in the above order, 
then you will have been forwarded to the error page (which isn't suppose to 
happen because you are "logged in")...

...also, the applet's "Standard Area Page" link to the action will also work 
correctly, *BUT ONLY IF* index.jsp is the first page loaded...

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



RE: HELP: applet-to-action anomaly

2004-03-23 Thread Pady Srinivasan

For me, clicking on "Standard Area Page: took me to the page with "SoA site
- Standard area...". It seems to work ok.
 

Thanks
 
-- pady
[EMAIL PROTECTED]
 

-Original Message-
From: w i l l i a m b o y d [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 23, 2004 12:57 AM
To: [EMAIL PROTECTED]
Subject: HELP: applet-to-action anomaly

hi,

please can someone help? i am building a struts 1.1 based web app using 
j2sdk1.4.2, tomcat 4.0.6. i'm using a 3rd-party tree applet for site 
navigation (a constraint specified by the client). i've got an action which 
can be accessed with this uri:

http://www.thefreelancer.net:8080/soa/jsp/enterAreaToRead.do?areaid=3

if you attempt to load this uri directly into your browser (i'm testing with

msie 6.0 on win xp home) then, as expected, the action fails, and forwards 
to a dummy error page placeholder letting you know that you haven't logged 
in yet. that is what should happen if you try to enter the area without 
having logged in.

i've got another dummy page where you can see this 3rd-party navigation 
applet i mentioned:

http://www.thefreelancer.net:8080/soa/jsp/mockups/index.jsp

for testing, within a scriptlet inside index.jsp, i've simulated a logged-in

user by instantiating a user bean and putting 

this user bean in the session when this index.jsp page loads. to verify that

this user bean is, in fact, in the session, i write out the user bean's 
email address at the very bottom of the page (the bit in red that 
says, "there is a reader in the session: bebop-at-propelnewmedia.com"). 

the navigation applet reads in a text file that contains the links needed to

render the nodes. i've set the "Standard Area Page" node to point at the 
enterAreaToRead.do?areaid=3 action:

The Society
|
+ Groups
|
|_Lorem Ipsum
|
+ BRG
| 
+ PCG
|
+ UMSIG
|
|_ Standard Area Page <-- points to action
|
|_ Lorem Ipsum
|
|_ Lorem Ipsum
|
|_ Lorem Ipsum
|
|_ Lorem Ipsum


the problem is: under certain conditions, loading the index.jsp page, then 
clicking on the "Standard Area Page" node in the applet takes you to the 
error page when it shouldn't. it shouldn't because the action should only 
forward to that error page 

if there is no user bean in the session. but there *IS* a user bean in the 
session which is verified by the presence of the bean's email address which 
i pull out of the session at the very bottom of index.jsp. this is how to 
reproduce the problem:

1) *FIRST* load
http://www.thefreelancer.net:8080/soa/jsp/enterAreaToRead.do?
areaid=3. you should be taken to the error page.

2) then, load http://www.thefreelancer.net:8080/soa/jsp/mockups/index.jsp. 
you can see that the user is "logged in" by the 

message at the very bottom of the page.

3) then click on the "Standard Area Page" node of the navigation applet on 
the left-hand side of the page. if you've done the steps in the above order,

then you will have been forwarded to the error page (which isn't suppose to 
happen because you are "logged in").

the curious thing is: also at the very bottom of the index,jsp page is 
an "Enter Area" link (rendered by an "html:link" tag) that points to the 
exact same action that the applet points to. the action forwards correctly 
if you click on this link. 

also, the applet's "Standard Area Page" link to the action will also work 
correctly, *BUT ONLY IF* index.jsp is the first page loaded. i suspect that 
it is something to do with the applet not knowing about the session for some

reason. short of recoding the 

applet by having it append the session string to the uri via a passed-in 
parameter, is there some other - more straight forward (struts-specific 
maybe) -  way around this problem that you know of?

thanks in advance for your help.

--
Open WebMail Project (http://openwebmail.org)
--- End of Forwarded Message ---


--
Open WebMail Project (http://openwebmail.org)


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


__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
__

__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
__

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



RE: help in java script

2004-03-15 Thread Andrew Hill
Remember the JSP script is evaluated server side and its result is what is
rendered to the browser.
Only the resulting html is what is evaluated by the browser which knows
nothing of the original scriptlets.

To check this out just do 'view source' in your browser on the page so you
can see what is actually being rendered to the response and seen by the
browser!

% String value="hello";%>


Will cause (something like) this to be rendered:



BTW: Should have spotted earlier the "javascript:" which also is not
wanted - you only use that for hrefs! Take that out you get:


As you can see you are trying to pass a javascript variable named hello to
your method.
Surely you want to pass a javascript string containing the text hello?
ie:


Hence my suggestion to add in the quotes.
And lose that "javascript:" prefix!
(And shove a semicolon on the end though I think its optional in this case!)

hth
Andrew

-Original Message-
From: Andreas Solarik [mailto:[EMAIL PROTECTED]
Sent: Monday, 15 March 2004 17:57
To: 'Struts Users Mailing List'
Subject: AW: help in java script


Hi Andrew and Shobhana,

As far as I know, you cant mix static text and dynamic text within a JSP. If
I remember correctly, something like the following code should work.

<%
  String tempString="javascript:find(" + value + "\";"; // Not sure about
the semicolon...
%>

and then:



I'll make sure to try the single quotes (') around the dynamic text some
time, cause it's really annoying to use the method im describing here.


Regards, Andreas

-Ursprüngliche Nachricht-
Von: Andrew Hill [mailto:[EMAIL PROTECTED]
Gesendet: Montag, 15. M?rz 2004 10:30
An: Struts Users Mailing List
Betreff: RE: help in java script


Should not that be:



(note the ' around value)

-Original Message-
From: Shobhana.S, ASDC Chennai [mailto:[EMAIL PROTECTED]
Sent: Monday, 15 March 2004 17:27
To: Struts Users Mailing List
Subject: help in java script


Hi !

I'm getting a problem when i use java script in my struts application.

My code runs as follows:


funtion change(value)
 {
 alert(value);
}



...
,,,
<% String value="hello";%>


the problem is the onchange event is not being called.

when i don't pass a scriplet variable the event gets called..say
onchange="javascript:find('hello'); it gets callled..

could anyone suggest me how to pass a dynamic value to javascript function
in struts?

Thank you.

Shobhana



-
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: help in java script

2004-03-15 Thread Shobhana.S, ASDC Chennai


Hi Andreas!

It worked..Thank you.

Shobhana



-Original Message-
From: Andreas Solarik [mailto:[EMAIL PROTECTED]
Sent: Monday, March 15, 2004 3:27 PM
To: 'Struts Users Mailing List'
Subject: AW: help in java script


Hi Andrew and Shobhana,

As far as I know, you cant mix static text and dynamic text within a JSP. If
I remember correctly, something like the following code should work.

<%
  String tempString="javascript:find(" + value + "\";"; // Not sure about
the semicolon...
%>

and then:



I'll make sure to try the single quotes (') around the dynamic text some
time, cause it's really annoying to use the method im describing here.


Regards, Andreas

-Ursprüngliche Nachricht-
Von: Andrew Hill [mailto:[EMAIL PROTECTED]
Gesendet: Montag, 15. M?rz 2004 10:30
An: Struts Users Mailing List
Betreff: RE: help in java script


Should not that be:



(note the ' around value)

-Original Message-
From: Shobhana.S, ASDC Chennai [mailto:[EMAIL PROTECTED]
Sent: Monday, 15 March 2004 17:27
To: Struts Users Mailing List
Subject: help in java script


Hi !

I'm getting a problem when i use java script in my struts application.

My code runs as follows:


funtion change(value)
 {
 alert(value);
}



...
,,,
<% String value="hello";%>


the problem is the onchange event is not being called.

when i don't pass a scriplet variable the event gets called..say
onchange="javascript:find('hello'); it gets callled..

could anyone suggest me how to pass a dynamic value to javascript function
in struts?

Thank you.

Shobhana



-
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: help in java script

2004-03-15 Thread Shobhana.S, ASDC Chennai
Hi!

If my value is an int variable then how shld i pass the value>?

Say,

<% 
int value=10;
%>

I want to pass this value to my onchange event. 

Unliek this case where i've defined the value in my program the value is
determined dynamically.

Thank you

Shobhana


RE: help in java script

2004-03-15 Thread Andrew Hill
Should not that be:



(note the ' around value)

-Original Message-
From: Shobhana.S, ASDC Chennai [mailto:[EMAIL PROTECTED]
Sent: Monday, 15 March 2004 17:27
To: Struts Users Mailing List
Subject: help in java script


Hi !

I'm getting a problem when i use java script in my struts application.

My code runs as follows:


funtion change(value)
 {
 alert(value);
}



...
,,,
<% String value="hello";%>


the problem is the onchange event is not being called.

when i don't pass a scriplet variable the event gets called..say
onchange="javascript:find('hello'); it gets callled..

could anyone suggest me how to pass a dynamic value to javascript function
in struts?

Thank you.

Shobhana



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



RE: Help on struts

2004-03-13 Thread Andrew Hill
I guess the first thing to consider is what you mean by "come back to the
previous page".
Do you just mean have the user redirected back to that url when they have
finished playing with the search? or is it more complex. For example the
previous page is a form, and they are halfway through filling it in when
they need to search, and on completion need to take up where they left off
with filling it in?

In the first case the easiest way (Im assuming there are multiple places
that send you to the search page) might be to have the link to the search
page add a parameter to the url containing the name of an ActionForward that
will take the user back to this page.

The search page can make note of this forward name, and when the user is
finished searching can look it up and return it as the forward from the
searchs action.

-Original Message-
From: Shoaib [mailto:[EMAIL PROTECTED]
Sent: Saturday, 13 March 2004 14:01
To: 'Struts Users Mailing List'
Subject: Help on struts


We are using struts 1.1.

We have some pages where user is going to have some search icon and if
user clicks on that then he will move to search page where he can search
the value and then come back to the previous page.

Can somebody please give some idea how to do it.

Regards
Shoaib


-
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: help implementing modules...

2004-03-12 Thread Damm, Gary
Thanks, this is the best explanation I've read so far on switching
modules.

One issue I have with this.  In my applications I always have an
application specific BaseAction that all of my Action classes extend
from.  This is to enforce my business rules on every request.  I do not
use generic/predefined Actions.  When I have found the need for the
functionality of the predefined actions (Success, Dispatch, Switch, etc)
I've reimplemented them so they extend my BaseAction.

What I would like to see, and this is targeted to the community in
general, is a way to use these generic behaviors without having to
bypass my BaseAction or reimplement them.  Maybe as helper classes that
I call from my actions.  

There are several ways to solve this and I just thought I should put it
out there to see if others have experienced the same issues and have
some other solutions.

> -Original Message-
> From: Srikanth Shenoy [mailto:[EMAIL PROTECTED]
> Sent: Thursday, March 11, 2004 7:30 PM
> To: [EMAIL PROTECTED]
> Subject: Re: help implementing modules...
> 
> Hi Gary,
> 
> I would suggest download the following free chapter from my book -
> Struts Survival Guide.
> Go to http://www.objectsource.com and find the link there to download
> Chapter 4.
> It tells you how to setup and use modules.
> 
> Hope that helps,
> 
>   Srikanth Shenoy
>   Author
>   Struts Survival Guide: Basics to Best Practices
> <http://www.objectsource.com/strutsbook.html>
>   J2EE Project Survival Guide
> <http://www.theserverside.com/books/review/J2EESurvivalGuide.tss>
> 
> 
> "Damm, Gary" <[EMAIL PROTECTED]> wrote in message
>
news:<[EMAIL PROTECTED]>...
> I've successfully used Struts for several applications and have been
> very happy with it.  I am getting ready to use it for a larger project
> and would like to use modules but I'm having some problems.
> 
> It appears that when I attempt to switch from the default module to a
> new module (module1) it never actually recognizes the new module.
When
> I attempt to go to a page in the new module that references an action
> that is defined in the new module action mappings I consistently get
the
> following error.  I have looked through the documentation and browsed
> the list archive and still can not figure out what I'm doing wrong.
Any
> help appreciated.
> 
> Also, if anyone knows a good book that documents modules well I'd like
> to know (Struts In Action and Jakarta Struts have little information
on
> modules).
> 
> The error:
> ...
> [2004/03/11 11:23:07] Cannot retrieve mapping for action /DomainSearch
> javax.servlet.jsp.JspException: Cannot retrieve mapping for action
> /DomainSearch
> at
> org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:810)
> at
> org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:506)
> at
>
org.apache.strutsel.taglib.html.ELFormTag.doStartTag(ELFormTag.java:324)
> at _module1._home__jsp._jspService(_home__jsp.java:448)
> ...
> 
> Here is my web.xml where I define the module:
> 
> ...
> 
>   config/module1
>   /WEB-INF/struts-config-module1.xml
> 
> ...
> 
> Here is my forward to the page in module1:
> ...
>path="/Module1HomeLink"
>   type="com.qualcomm.bds.struts.SampleAppSuccessAction"
>   unknown="false"
>   validate="false" >
> 
>  name="success"
>   path="/module1/Home.jsp"
>   contextRelative="true"
>   redirect="true" />
> 
> 
> ...
> 
> Here is my link on the originating jsp (in default module):
> ...
>  key="label.module1"/>
> ...
> 
> Here is the form in the new module that references the action: ...
>  ...
> 
> Here is the action in the module1 config file:
> ...
>path="/DomainSearch"
>   name="SearchForm"
>   type="com.qualcomm.bds.struts.SampleAppSearchAction"
>   unknown="false"
>   validate="true"
>   input="/module1/Home.jsp" >
> 
>name="success"
> path="/module1/List.jsp"
> contextRelative="true" />
> 
>  key="errors.generic"
>   type="java.lang.Exception"/>
> 
> 
> ...
> --

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



RE: help implementing modules...

2004-03-12 Thread Liu, Anne I
After doing a little more research, it looks like the html:form tag only
uses the current module.  Thus, what you need to do is switch modules before
you do a form post.

One way to do this is change your default config xml to link to the html
form page in your module1



 



Then in your struts-config-module1.xml add the following entry




Hope this helps!
> -Original Message-
> From: Liu, Anne I [SMTP:[EMAIL PROTECTED]
> Sent: Friday, March 12, 2004 10:13 AM
> To:   'Struts Users Mailing List'
> Subject:  RE: help implementing modules...
> 
> I think it might be a problem with using the html tag library?? 
> 
> I use straight HTML and it seems to work fine
> 
> 
> > -Original Message-
> > From:   Damm, Gary [SMTP:[EMAIL PROTECTED]
> > Sent:   Thursday, March 11, 2004 5:50 PM
> > To: Daniel; Struts Users Mailing List
> > Subject:RE: help implementing modules...
> > 
> > Thanks for the feedback.  I removed these and still the same problem.
> > 
> > Also, I originally put them in on the guidance of the UserGuide.
> > 
> > Anything else look like a problem?
> > 
> > Thanks,
> > Gary
> > 
> > > -Original Message-
> > > From: Daniel [mailto:[EMAIL PROTECTED]
> > > Sent: Thursday, March 11, 2004 1:41 PM
> > > To: Struts Users Mailing List
> > > Subject: Re: help implementing modules...
> > > 
> > > ops ;-) and contextRelative too.
> > > 
> > > 
> > > - Original Message -
> > > From: "Liu, Anne I" <[EMAIL PROTECTED]>
> > > To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
> > > Sent: Thursday, March 11, 2004 5:08 PM
> > > Subject: RE: help implementing modules...
> > > 
> > > 
> > > > I don't know if this will help, but you have to prepend the module
> > name
> > > into
> > > > your URL.
> > > >
> > > > Thus, your link should look like
> > > >
> > > > 
> > > >
> > > > I've found the short section in the struts the most helpful when
> > dealing
> > > > with modules
> > > >
> > > >
> > >
> > http://jakarta.apache.org/struts/userGuide/configuration.html#dd_config_
> > mo
> > > du
> > > > les
> > > >
> > > > > -Original Message-
> > > > > From: Damm, Gary [SMTP:[EMAIL PROTECTED]
> > > > > Sent: Thursday, March 11, 2004 1:56 PM
> > > > > To: [EMAIL PROTECTED]
> > > > > Subject: help implementing modules...
> > > > >
> > > > > I've successfully used Struts for several applications and have
> > been
> > > > > very happy with it.  I am getting ready to use it for a larger
> > project
> > > > > and would like to use modules but I'm having some problems.
> > > > >
> > > > > It appears that when I attempt to switch from the default module
> > to a
> > > > > new module (module1) it never actually recognizes the new module.
> > > When
> > > > > I attempt to go to a page in the new module that references an
> > action
> > > > > that is defined in the new module action mappings I consistently
> > get
> > > the
> > > > > following error.  I have looked through the documentation and
> > browsed
> > > > > the list archive and still can not figure out what I'm doing
> > wrong.
> > > Any
> > > > > help appreciated.
> > > > >
> > > > > Also, if anyone knows a good book that documents modules well I'd
> > like
> > > > > to know (Struts In Action and Jakarta Struts have little
> > information
> > > on
> > > > > modules).
> > > > >
> > > > > The error:
> > > > > ...
> > > > > [2004/03/11 11:23:07] Cannot retrieve mapping for action
> > /DomainSearch
> > > > > javax.servlet.jsp.JspException: Cannot retrieve mapping for action
> > > > > /DomainSearch
> > > > > at
> > > > > org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:810)
> > > > > at
> > > > > org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:506)
> > > > > at
> > > > >
> 

RE: help implementing modules...

2004-03-12 Thread Liu, Anne I
I think it might be a problem with using the html tag library?? 

I use straight HTML and it seems to work fine


> -Original Message-
> From: Damm, Gary [SMTP:[EMAIL PROTECTED]
> Sent: Thursday, March 11, 2004 5:50 PM
> To:   Daniel; Struts Users Mailing List
> Subject:  RE: help implementing modules...
> 
> Thanks for the feedback.  I removed these and still the same problem.
> 
> Also, I originally put them in on the guidance of the UserGuide.
> 
> Anything else look like a problem?
> 
> Thanks,
> Gary
> 
> > -Original Message-
> > From: Daniel [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, March 11, 2004 1:41 PM
> > To: Struts Users Mailing List
> > Subject: Re: help implementing modules...
> > 
> > ops ;-) and contextRelative too.
> > 
> > 
> > - Original Message -
> > From: "Liu, Anne I" <[EMAIL PROTECTED]>
> > To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
> > Sent: Thursday, March 11, 2004 5:08 PM
> > Subject: RE: help implementing modules...
> > 
> > 
> > > I don't know if this will help, but you have to prepend the module
> name
> > into
> > > your URL.
> > >
> > > Thus, your link should look like
> > >
> > > 
> > >
> > > I've found the short section in the struts the most helpful when
> dealing
> > > with modules
> > >
> > >
> >
> http://jakarta.apache.org/struts/userGuide/configuration.html#dd_config_
> mo
> > du
> > > les
> > >
> > > > -Original Message-
> > > > From: Damm, Gary [SMTP:[EMAIL PROTECTED]
> > > > Sent: Thursday, March 11, 2004 1:56 PM
> > > > To: [EMAIL PROTECTED]
> > > > Subject: help implementing modules...
> > > >
> > > > I've successfully used Struts for several applications and have
> been
> > > > very happy with it.  I am getting ready to use it for a larger
> project
> > > > and would like to use modules but I'm having some problems.
> > > >
> > > > It appears that when I attempt to switch from the default module
> to a
> > > > new module (module1) it never actually recognizes the new module.
> > When
> > > > I attempt to go to a page in the new module that references an
> action
> > > > that is defined in the new module action mappings I consistently
> get
> > the
> > > > following error.  I have looked through the documentation and
> browsed
> > > > the list archive and still can not figure out what I'm doing
> wrong.
> > Any
> > > > help appreciated.
> > > >
> > > > Also, if anyone knows a good book that documents modules well I'd
> like
> > > > to know (Struts In Action and Jakarta Struts have little
> information
> > on
> > > > modules).
> > > >
> > > > The error:
> > > > ...
> > > > [2004/03/11 11:23:07] Cannot retrieve mapping for action
> /DomainSearch
> > > > javax.servlet.jsp.JspException: Cannot retrieve mapping for action
> > > > /DomainSearch
> > > > at
> > > > org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:810)
> > > > at
> > > > org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:506)
> > > > at
> > > >
> >
> org.apache.strutsel.taglib.html.ELFormTag.doStartTag(ELFormTag.java:324)
> > > > at _module1._home__jsp._jspService(_home__jsp.java:448)
> > > > ...
> > > >
> > > > Here is my web.xml where I define the module:
> > > >
> > > > ...
> > > > 
> > > > config/module1
> > > > /WEB-INF/struts-config-module1.xml
> > > > 
> > > > ...
> > > >
> > > > Here is my forward to the page in module1:
> > > > ...
> > > >  > > >   path="/Module1HomeLink"
> > > >   type="com.qualcomm.bds.struts.SampleAppSuccessAction"
> > > >   unknown="false"
> > > >   validate="false" >
> > > >
> > > >> > > name="success"
> > > > path="/module1/Home.jsp"
> > > > contextRelative="true"
> > > > redirect="true" />
> > > >
> > > &

Re: help! I m going mad

2004-03-12 Thread Siamack
Hello:
 
the  "name" attribute in your logic:iterate should be your object name not your class 
name. Hope this helps.
 

   
<%-- --%>
   
   Submit Changes




 
regards,
 
 



-
Post your free ad now! Yahoo! Canada Personals


Re: help! I m going mad

2004-03-12 Thread Niall Pemberton
In your struts-config.xml, is the action which initially displays your jsp
page associated with TestBeanForm?

Niall

- Original Message - 
From: "Mu Mike" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, March 12, 2004 10:17 AM
Subject: help! I m going mad


> I just cant use logic:iterate correctly!
>
> this is my form bean class:
> public class TestBeanForm extends ActionForm {
>
> public String[] getTestBean() {
> return testBean;
> }
>
> public void setTestBean(String[] testBean) {
> this.testBean = testBean;
> }
>
> String[] testBean;
>
> and this is my form bean declaration
> 
> and this is what I have in my jsp file:
>
> 
> indexId="index1" >
> <%-- --%>
>
>Submit Changes
> 
>
> you can see, I commented out the  line, but I still kept
getting
> "No collection found" error, why? arent String[] a collection?
>
> _
> 与联机的朋友进行交流,请使用 MSN Messenger:  http://messenger.msn.com/cn
>
>
> -
> 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: help! I m going mad

2004-03-12 Thread Mark Lowe
Okay here's a full example, first of all i'm going to mess with your 
naming conventions as they'd drive me mad also
//bean
package com.sparrow.struts;

public class TestBean {
private String name;
public String getName() {
return name;
}   

public void setName(String name) {
this.name = name;
}
}
//the form
package com.sparrow.struts;
import java.util.ArrayList;
import java.util.List;
import org.apache.struts.action.ActionForm;
import org.apache.commons.collections.ListUtils;
import org.apache.commons.collections.Factory;
public class TestBeanForm extends ActionForm {

	private List testBeanList;

public SizesForm() {
initLists();
}
private void initLists() {
Factory factory = new Factory() {
public Object create() {
return new TestBean();
}
};
this. testBeanList = ListUtils.lazyList(new ArrayList(), 
factory);
}
	
	public List getTestBeans() {
		return testBeanList;
	}

public void setTestBeans(List testBeanList) {
this. testBeanList = testBeanList;
}
public TestBean getTestBean(int index) {
return (TestBean) testBeanList.get(index);
}
public void setTestBean(int index,TestBean testBean) {
this. testBeanList.add(index, testBean);
}
}

//struts config





//jsp





...




On 12 Mar 2004, at 11:17, Mu Mike wrote:

I just cant use logic:iterate correctly!

this is my form bean class:
public class TestBeanForm extends ActionForm {
   public String[] getTestBean() {
   return testBean;
   }
   public void setTestBean(String[] testBean) {
   this.testBean = testBean;
   }
   String[] testBean;

and this is my form bean declaration
   
and this is what I have in my jsp file:


  
<%-- --%>
  
  Submit Changes


you can see, I commented out the  line, but I still kept 
getting "No collection found" error, why? arent String[] a collection?

_
~{SkA*;z5DEsSQ=xPP=;Aw#,GkJ9SC~} MSN Messenger:  http://messenger.msn.com/cn
-
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: help me about indexed properties

2004-03-11 Thread Mu Mike
Thank you 
Craig

now I have a form

TestBeanForm.java
public class TestBeanForm extends ActionForm {
   public ArrayList getTestBean() {
   if(testBean==null)
 testBean=new ArrayList();
   return testBean;
   }
   public void setTestBean(ArrayList testBean) {
   this.testBean = testBean;
   }
   private ArrayList  testBean;

}

and I write in the jsp this:

  
   
 (QUESTION: I DONT KNOW WHAT TO SET TO THIS PROPERTY NOW, YET IT 
IS A MUST HAVE ATTRIBUTE)  

  
  Submit Changes

and this is what I have in my configuration file

   
   
what should I do to submit values for my ArrayList type object testBean?

well, I suddenly found that testBean is not a bean, so those I have in the 
jsp file is meaningless, but then how can I submit values for an ArrayList 
object?

Thanks&Regards






From: "Craig Tataryn" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: RE: help me about indexed properties
Date: Thu, 11 Mar 2004 21:11:42 -0600 (CST)
Hi Mike, the attributes for logic iterate are all explained here:
http://jakarta.apache.org/struts/userGuide/struts-logic.html#iterate
and
http://jakarta.apache.org/struts/faqs/indexedprops.html
I've put it in my own words for you below:

For logic:iterate
==
name attribute: tag looks in all three scopes 
(page,request,application)for a bean with the name
equal to the value of this attribute.  If it is found, and there is no 
"property" attribute
specified elsewhere in the tag, then it will use the bean from the name 
attribute as the List/Map to
iterate over.

property attribute: The property specified in the property attribute will 
be applied against the
bean found in the name attribute and the value of this property will be 
used as the List/Map to
iterate.  So if you specify name="MyForm" and property="addresses" then 
the list which will be
iterated over will be the value passed back from the interate tag 
evaluating MyForm.getAddresses()
id attribute: for each loop of the iterate tag, place the next element 
from the list into a
page-level bean named by the value of the id attribute.

idIndex attribute: for each loop of the iterate tag, place the current 
index value of the element
from our List in the page-level int variable named by the value of the 
idIndex attribute (value is
in [0..list.length])

For html:text
===
The attributes are pretty well explained in
http://jakarta.apache.org/struts/userGuide/struts-html.html#text
Hope that's enough to get you started.

Craig

On Fri, 12 Mar 2004 02:53:11 +, "Mu Mike" wrote:

>
> sorry, the last mail doesnt display correctly, but when I tried to 
write a
> new one, I saw it displays correctly as the below
>
> Thanks&Regards
>
> >From: "Mu Mike" <[EMAIL PROTECTED]>
> >Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> >To: [EMAIL PROTECTED]
> >Subject: help me about  indexed properties
> >Date: Fri, 12 Mar 2004 02:49:47 +
> >
> >I have the below jsp file needs help
> >
> >
> >
> ><%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
> ><%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
> >
> >
> >  
> >>  indexId="ctr">
> >
> > >   property='<%= "labelValue[" + ctr + "].label" %>' />
> >
> >
> >   
> >   Submit Changes
> >  
> >
> >
> >
> >and I dont have the related bean files ,can anyone give me example
> >bean files that can be used for this jsp file?
> >
> >Thanks&Regards
> >
> >_
> >与联机的朋友进行交流,请使用 MSN Messenger:
> >http://messenger.msn.com/cn
> >
> >
> >-
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
> _
> 享用世界上最大的电子邮件系统? MSN Hotmail。  http://www.hotmail.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]
_
与联机的朋友进行交流,请使用 MSN Messenger:  http://messenger.msn.com/cn  

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


Re: help implementing modules...

2004-03-11 Thread Srikanth Shenoy
Hi Gary,

I would suggest download the following free chapter from my book -
Struts Survival Guide.
Go to http://www.objectsource.com and find the link there to download
Chapter 4.
It tells you how to setup and use modules.

Hope that helps,

  Srikanth Shenoy
  Author
  Struts Survival Guide: Basics to Best Practices
 
  J2EE Project Survival Guide
 


"Damm, Gary" <[EMAIL PROTECTED]> wrote in message
news:<[EMAIL PROTECTED]>...
I've successfully used Struts for several applications and have been
very happy with it.  I am getting ready to use it for a larger project
and would like to use modules but I'm having some problems.

It appears that when I attempt to switch from the default module to a
new module (module1) it never actually recognizes the new module.  When
I attempt to go to a page in the new module that references an action
that is defined in the new module action mappings I consistently get the
following error.  I have looked through the documentation and browsed
the list archive and still can not figure out what I'm doing wrong.  Any
help appreciated.

Also, if anyone knows a good book that documents modules well I'd like
to know (Struts In Action and Jakarta Struts have little information on
modules).

The error:
...
[2004/03/11 11:23:07] Cannot retrieve mapping for action /DomainSearch
javax.servlet.jsp.JspException: Cannot retrieve mapping for action
/DomainSearch
at
org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:810)
at
org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:506)
at
org.apache.strutsel.taglib.html.ELFormTag.doStartTag(ELFormTag.java:324)
at _module1._home__jsp._jspService(_home__jsp.java:448)
...

Here is my web.xml where I define the module:

...

config/module1
/WEB-INF/struts-config-module1.xml

...

Here is my forward to the page in module1:
...

  
  


...

Here is my link on the originating jsp (in default module):
...

...

Here is the form in the new module that references the action: ...
 ...

Here is the action in the module1 config file:
...

  
  




...
--


RE: help me about indexed properties

2004-03-11 Thread Craig Tataryn
Hi Mike, the attributes for logic iterate are all explained here:
http://jakarta.apache.org/struts/userGuide/struts-logic.html#iterate
and
http://jakarta.apache.org/struts/faqs/indexedprops.html

I've put it in my own words for you below:

For logic:iterate
==
name attribute: tag looks in all three scopes (page,request,application)for a bean 
with the name
equal to the value of this attribute.  If it is found, and there is no "property" 
attribute
specified elsewhere in the tag, then it will use the bean from the name attribute as 
the List/Map to
iterate over.

property attribute: The property specified in the property attribute will be applied 
against the
bean found in the name attribute and the value of this property will be used as the 
List/Map to
iterate.  So if you specify name="MyForm" and property="addresses" then the list which 
will be
iterated over will be the value passed back from the interate tag evaluating 
MyForm.getAddresses()

id attribute: for each loop of the iterate tag, place the next element from the list 
into a
page-level bean named by the value of the id attribute.

idIndex attribute: for each loop of the iterate tag, place the current index value of 
the element
from our List in the page-level int variable named by the value of the idIndex 
attribute (value is
in [0..list.length])

For html:text
===
The attributes are pretty well explained in
http://jakarta.apache.org/struts/userGuide/struts-html.html#text

Hope that's enough to get you started.

Craig


On Fri, 12 Mar 2004 02:53:11 +, "Mu Mike" wrote:

> 
> sorry, the last mail doesnt display correctly, but when I tried to write a 
> new one, I saw it displays correctly as the below
> 
> Thanks&Regards
> 
> >From: "Mu Mike" <[EMAIL PROTECTED]>
> >Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> >To: [EMAIL PROTECTED]
> >Subject: help me about  indexed properties
> >Date: Fri, 12 Mar 2004 02:49:47 +
> >
> >I have the below jsp file needs help
> >
> >
> >
> ><%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
> ><%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
> >
> >
> >  
> >>  indexId="ctr">
> >
> > >   property='<%= "labelValue[" + ctr + "].label" %>' />
> >
> >
> >   
> >   Submit Changes
> >  
> >
> >
> >
> >and I dont have the related bean files ,can anyone give me example 
> >bean files that can be used for this jsp file?
> >
> >Thanks&Regards
> >
> >_
> >ÓëÁª»úµÄÅóÓѽøÐн»Á÷£¬ÇëʹÓà MSN Messenger:  
> >http://messenger.msn.com/cn
> >
> >
> >-
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >
> 
> _
> ÏíÓÃÊÀ½çÉÏ×î´óµÄµç×ÓÓʼþϵͳ¨D MSN Hotmail¡£  http://www.hotmail.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: help me about indexed properties

2004-03-11 Thread Mu Mike
sorry, the last mail doesnt display correctly, but when I tried to write a 
new one, I saw it displays correctly as the below

Thanks&Regards

From: "Mu Mike" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: help me about  indexed properties
Date: Fri, 12 Mar 2004 02:49:47 +
I have the below jsp file needs help



<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>


 
  
 indexId="ctr">
   
   
  property='<%= "labelValue[" + ctr + "].label" %>' />
   

  
  Submit Changes
 


and I dont have the related bean files ,can anyone give me example 
bean files that can be used for this jsp file?

Thanks&Regards

_
与联机的朋友进行交流,请使用 MSN Messenger:  
http://messenger.msn.com/cn

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
_
享用世界上最大的电子邮件系统― MSN Hotmail。  http://www.hotmail.com  

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


RE: help implementing modules...

2004-03-11 Thread Damm, Gary
Thanks for the feedback.  I removed these and still the same problem.

Also, I originally put them in on the guidance of the UserGuide.

Anything else look like a problem?

Thanks,
Gary

> -Original Message-
> From: Daniel [mailto:[EMAIL PROTECTED]
> Sent: Thursday, March 11, 2004 1:41 PM
> To: Struts Users Mailing List
> Subject: Re: help implementing modules...
> 
> ops ;-) and contextRelative too.
> 
> 
> - Original Message -
> From: "Liu, Anne I" <[EMAIL PROTECTED]>
> To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
> Sent: Thursday, March 11, 2004 5:08 PM
> Subject: RE: help implementing modules...
> 
> 
> > I don't know if this will help, but you have to prepend the module
name
> into
> > your URL.
> >
> > Thus, your link should look like
> >
> > 
> >
> > I've found the short section in the struts the most helpful when
dealing
> > with modules
> >
> >
>
http://jakarta.apache.org/struts/userGuide/configuration.html#dd_config_
mo
> du
> > les
> >
> > > -Original Message-
> > > From: Damm, Gary [SMTP:[EMAIL PROTECTED]
> > > Sent: Thursday, March 11, 2004 1:56 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: help implementing modules...
> > >
> > > I've successfully used Struts for several applications and have
been
> > > very happy with it.  I am getting ready to use it for a larger
project
> > > and would like to use modules but I'm having some problems.
> > >
> > > It appears that when I attempt to switch from the default module
to a
> > > new module (module1) it never actually recognizes the new module.
> When
> > > I attempt to go to a page in the new module that references an
action
> > > that is defined in the new module action mappings I consistently
get
> the
> > > following error.  I have looked through the documentation and
browsed
> > > the list archive and still can not figure out what I'm doing
wrong.
> Any
> > > help appreciated.
> > >
> > > Also, if anyone knows a good book that documents modules well I'd
like
> > > to know (Struts In Action and Jakarta Struts have little
information
> on
> > > modules).
> > >
> > > The error:
> > > ...
> > > [2004/03/11 11:23:07] Cannot retrieve mapping for action
/DomainSearch
> > > javax.servlet.jsp.JspException: Cannot retrieve mapping for action
> > > /DomainSearch
> > > at
> > > org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:810)
> > > at
> > > org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:506)
> > > at
> > >
>
org.apache.strutsel.taglib.html.ELFormTag.doStartTag(ELFormTag.java:324)
> > > at _module1._home__jsp._jspService(_home__jsp.java:448)
> > > ...
> > >
> > > Here is my web.xml where I define the module:
> > >
> > > ...
> > > 
> > > config/module1
> > > /WEB-INF/struts-config-module1.xml
> > > 
> > > ...
> > >
> > > Here is my forward to the page in module1:
> > > ...
> > >  > >   path="/Module1HomeLink"
> > >   type="com.qualcomm.bds.struts.SampleAppSuccessAction"
> > >   unknown="false"
> > >   validate="false" >
> > >
> > >> > name="success"
> > > path="/module1/Home.jsp"
> > > contextRelative="true"
> > > redirect="true" />
> > >
> > > 
> > > ...
> > >
> > > Here is my link on the originating jsp (in default module):
> > > ...
> > >  > > key="label.module1"/>
> > > ...
> > >
> > > Here is the form in the new module that references the action:
> > > ...
> > > 
> > > ...
> > >
> > > Here is the action in the module1 config file:
> > > ...
> > >  > >   path="/DomainSearch"
> > >   name="SearchForm"
> > >   type="com.qualcomm.bds.struts.SampleAppSearchAction"
> > >   unknown="false"
> > >   validate="true"
> > >   input="/module1/Home.jsp" >
> > >
> > >> > name="success"
> > > path="/module1/List.jsp"
> > > contextRelative="true" />
> > >
> > >  > > key="errors.generic"
> > > type="java.lang.Exception"/>
> > >
> > > 
> > > ...
> > >
> > >
-
> > > 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: help implementing modules...

2004-03-11 Thread Daniel
ops ;-) and contextRelative too.


- Original Message - 
From: "Liu, Anne I" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Thursday, March 11, 2004 5:08 PM
Subject: RE: help implementing modules...


> I don't know if this will help, but you have to prepend the module name
into
> your URL.
>
> Thus, your link should look like
>
> 
>
> I've found the short section in the struts the most helpful when dealing
> with modules
>
>
http://jakarta.apache.org/struts/userGuide/configuration.html#dd_config_modu
> les
>
> > -Original Message-
> > From: Damm, Gary [SMTP:[EMAIL PROTECTED]
> > Sent: Thursday, March 11, 2004 1:56 PM
> > To: [EMAIL PROTECTED]
> > Subject: help implementing modules...
> >
> > I've successfully used Struts for several applications and have been
> > very happy with it.  I am getting ready to use it for a larger project
> > and would like to use modules but I'm having some problems.
> >
> > It appears that when I attempt to switch from the default module to a
> > new module (module1) it never actually recognizes the new module.  When
> > I attempt to go to a page in the new module that references an action
> > that is defined in the new module action mappings I consistently get the
> > following error.  I have looked through the documentation and browsed
> > the list archive and still can not figure out what I'm doing wrong.  Any
> > help appreciated.
> >
> > Also, if anyone knows a good book that documents modules well I'd like
> > to know (Struts In Action and Jakarta Struts have little information on
> > modules).
> >
> > The error:
> > ...
> > [2004/03/11 11:23:07] Cannot retrieve mapping for action /DomainSearch
> > javax.servlet.jsp.JspException: Cannot retrieve mapping for action
> > /DomainSearch
> > at
> > org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:810)
> > at
> > org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:506)
> > at
> > org.apache.strutsel.taglib.html.ELFormTag.doStartTag(ELFormTag.java:324)
> > at _module1._home__jsp._jspService(_home__jsp.java:448)
> > ...
> >
> > Here is my web.xml where I define the module:
> >
> > ...
> > 
> > config/module1
> > /WEB-INF/struts-config-module1.xml
> > 
> > ...
> >
> > Here is my forward to the page in module1:
> > ...
> >  >   path="/Module1HomeLink"
> >   type="com.qualcomm.bds.struts.SampleAppSuccessAction"
> >   unknown="false"
> >   validate="false" >
> >
> >> name="success"
> > path="/module1/Home.jsp"
> > contextRelative="true"
> > redirect="true" />
> >
> > 
> > ...
> >
> > Here is my link on the originating jsp (in default module):
> > ...
> >  > key="label.module1"/>
> > ...
> >
> > Here is the form in the new module that references the action:
> > ...
> > 
> > ...
> >
> > Here is the action in the module1 config file:
> > ...
> >  >   path="/DomainSearch"
> >   name="SearchForm"
> >   type="com.qualcomm.bds.struts.SampleAppSearchAction"
> >   unknown="false"
> >   validate="true"
> >   input="/module1/Home.jsp" >
> >
> >> name="success"
> > path="/module1/List.jsp"
> > contextRelative="true" />
> >
> >  > key="errors.generic"
> > type="java.lang.Exception"/>
> >
> > 
> > ...
> >
> > -
> > 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: help implementing modules...

2004-03-11 Thread Daniel
take out the redirect attribute.

Abraços
Daniel S.

- Original Message - 
From: "Liu, Anne I" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Thursday, March 11, 2004 5:08 PM
Subject: RE: help implementing modules...


> I don't know if this will help, but you have to prepend the module name
into
> your URL.
>
> Thus, your link should look like
>
> 
>
> I've found the short section in the struts the most helpful when dealing
> with modules
>
>
http://jakarta.apache.org/struts/userGuide/configuration.html#dd_config_modu
> les
>
> > -Original Message-
> > From: Damm, Gary [SMTP:[EMAIL PROTECTED]
> > Sent: Thursday, March 11, 2004 1:56 PM
> > To: [EMAIL PROTECTED]
> > Subject: help implementing modules...
> >
> > I've successfully used Struts for several applications and have been
> > very happy with it.  I am getting ready to use it for a larger project
> > and would like to use modules but I'm having some problems.
> >
> > It appears that when I attempt to switch from the default module to a
> > new module (module1) it never actually recognizes the new module.  When
> > I attempt to go to a page in the new module that references an action
> > that is defined in the new module action mappings I consistently get the
> > following error.  I have looked through the documentation and browsed
> > the list archive and still can not figure out what I'm doing wrong.  Any
> > help appreciated.
> >
> > Also, if anyone knows a good book that documents modules well I'd like
> > to know (Struts In Action and Jakarta Struts have little information on
> > modules).
> >
> > The error:
> > ...
> > [2004/03/11 11:23:07] Cannot retrieve mapping for action /DomainSearch
> > javax.servlet.jsp.JspException: Cannot retrieve mapping for action
> > /DomainSearch
> > at
> > org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:810)
> > at
> > org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:506)
> > at
> > org.apache.strutsel.taglib.html.ELFormTag.doStartTag(ELFormTag.java:324)
> > at _module1._home__jsp._jspService(_home__jsp.java:448)
> > ...
> >
> > Here is my web.xml where I define the module:
> >
> > ...
> > 
> > config/module1
> > /WEB-INF/struts-config-module1.xml
> > 
> > ...
> >
> > Here is my forward to the page in module1:
> > ...
> >  >   path="/Module1HomeLink"
> >   type="com.qualcomm.bds.struts.SampleAppSuccessAction"
> >   unknown="false"
> >   validate="false" >
> >
> >> name="success"
> > path="/module1/Home.jsp"
> > contextRelative="true"
> > redirect="true" />
> >
> > 
> > ...
> >
> > Here is my link on the originating jsp (in default module):
> > ...
> >  > key="label.module1"/>
> > ...
> >
> > Here is the form in the new module that references the action:
> > ...
> > 
> > ...
> >
> > Here is the action in the module1 config file:
> > ...
> >  >   path="/DomainSearch"
> >   name="SearchForm"
> >   type="com.qualcomm.bds.struts.SampleAppSearchAction"
> >   unknown="false"
> >   validate="true"
> >   input="/module1/Home.jsp" >
> >
> >> name="success"
> > path="/module1/List.jsp"
> > contextRelative="true" />
> >
> >  > key="errors.generic"
> > type="java.lang.Exception"/>
> >
> > 
> > ...
> >
> > -
> > 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: help implementing modules...

2004-03-11 Thread Liu, Anne I
I don't know if this will help, but you have to prepend the module name into
your URL.

Thus, your link should look like



I've found the short section in the struts the most helpful when dealing
with modules

http://jakarta.apache.org/struts/userGuide/configuration.html#dd_config_modu
les

> -Original Message-
> From: Damm, Gary [SMTP:[EMAIL PROTECTED]
> Sent: Thursday, March 11, 2004 1:56 PM
> To:   [EMAIL PROTECTED]
> Subject:  help implementing modules...
> 
> I've successfully used Struts for several applications and have been
> very happy with it.  I am getting ready to use it for a larger project
> and would like to use modules but I'm having some problems.
> 
> It appears that when I attempt to switch from the default module to a
> new module (module1) it never actually recognizes the new module.  When
> I attempt to go to a page in the new module that references an action
> that is defined in the new module action mappings I consistently get the
> following error.  I have looked through the documentation and browsed
> the list archive and still can not figure out what I'm doing wrong.  Any
> help appreciated.
> 
> Also, if anyone knows a good book that documents modules well I'd like
> to know (Struts In Action and Jakarta Struts have little information on
> modules).
> 
> The error:
> ...
> [2004/03/11 11:23:07] Cannot retrieve mapping for action /DomainSearch
> javax.servlet.jsp.JspException: Cannot retrieve mapping for action
> /DomainSearch
> at
> org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:810)
> at
> org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:506)
> at
> org.apache.strutsel.taglib.html.ELFormTag.doStartTag(ELFormTag.java:324)
> at _module1._home__jsp._jspService(_home__jsp.java:448)
> ...
> 
> Here is my web.xml where I define the module:
> 
> ...
> 
>   config/module1
>   /WEB-INF/struts-config-module1.xml
> 
> ...
> 
> Here is my forward to the page in module1:
> ...
>path="/Module1HomeLink"
>   type="com.qualcomm.bds.struts.SampleAppSuccessAction"
>   unknown="false"
>   validate="false" >
>   
>  name="success" 
>   path="/module1/Home.jsp"
>   contextRelative="true"
>   redirect="true" />
> 
> 
> ...
> 
> Here is my link on the originating jsp (in default module):
> ...
>  key="label.module1"/>
> ...
> 
> Here is the form in the new module that references the action:
> ...
> 
> ...
> 
> Here is the action in the module1 config file:
> ...
>path="/DomainSearch"
>   name="SearchForm"
>   type="com.qualcomm.bds.struts.SampleAppSearchAction"
>   unknown="false"
>   validate="true"
>   input="/module1/Home.jsp" >
>   
>name="success"
> path="/module1/List.jsp"
> contextRelative="true" />
> 
>  key="errors.generic" 
>   type="java.lang.Exception"/>
> 
> 
> ...
> 
> -
> 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: help me with using bean

2004-03-11 Thread shirishchandra.sakhare
Can you send the mail without the entrust cretificate?
I can not read the mail and hence help you :-((

> -Original Message-
> From: stu [mailto:[EMAIL PROTECTED]
> Sent: Thursday, March 11, 2004 3:04 PM
> To:   [EMAIL PROTECTED]
> Subject:  Re: help me with using bean
> 
>  << File: SMIME.txt >> 

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



Re: help me with using bean

2004-03-11 Thread stu
On Thu, 11 Mar 2004 01:30:38 +
"Mu Mike" <[EMAIL PROTECTED]> wrote:

> I have files like the below,I m  trying to submit a bean object to my 
> action class, yet when I pressed the "submit" on the jsp file,it threw
> an exception:java.lang.IllegalArgumentException: No bean specified
> 
> what is the correct way?
> Thanks&Regards
> 
> 
> myjsp.jsp
> 
> html:form action="/selectFont.do" >
> 
> 
>   
> 
> 
>   
> 
> 
> 
> 
> 

Don't you need the 'name' attribute in your html:text tags ie


   ^

-- 
Stuart Logie
Programmer

UNIVERSAL COMPUTER SERVICES (PTY) LTD
A member of South Africa's largest retail software vendor, the UCS Group

Tel : (011) 712 1371   Cell : 082 902 5632
Fax : (011) 339 3421
Internet : http://ucs.co.za

"I am the Unconquerable Spirit."
   -- Poet Unknown
   
Powered by Debian GNU/Linux - testing/unstable


pgp0.pgp
Description: PGP signature


RE: help about struts

2004-03-11 Thread Leticia Golubov
This is where I started:

Read Struts In Action (Published by Manning) book.
http://www.manning.com/husted/index.html

Resources:
http://jakarta.apache.org/struts/
http://jakarta.apache.org/index.html


-Original Message-
From: EROL TEZCAN [mailto:[EMAIL PROTECTED]
Sent: 11 March 2004 10:11
To: [EMAIL PROTECTED]
Subject: help about struts


Hi ,

I want to work with struts.

But i dont know where will I start first?

What I need for working with struts?

Where should I start first?

Can I work struts on Resin , or only Tomcat?

Which files needed to work struts.?

Please help me ?

Erol Tezcan




-
Do you Yahoo!?
Yahoo! Search - Find what youre looking for faster.


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



RE: help me with using bean

2004-03-10 Thread Mu Mike
ok, I have solved the problem,seems I should use  instead but 
not 
by the way,thank you all ,especially David

Thanks&Regards



From: "Mu Mike" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: RE: help me with using bean
Date: Thu, 11 Mar 2004 04:33:16 +
well, I said I was new because I began struts only a week ago and i 
have succefully submitted those 'primary' type values to an action. 
About the forward, I m using tiles tag in struts, StartPage.jsp is 
the first page I go to.

the tiles definition is the below

tiledef.xml


 
   



MainLayout.jsp

<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>


<%%>
<%%>


StartPage.jsp:
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>









From: "David Friedman" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" 
<[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Subject: RE: help me with using bean
Date: Wed, 10 Mar 2004 22:29:01 -0500

Mike,

You wrote are new to Struts so have you tried this without nesting 
a Bean
within a form?  I.E. by making an ActionForm which has "size" and
"fontName"
properties then copying them if you need to use them somewhere 
else?  Then
you could access the properties not as "bean.size" and 
"bean.fontName" but
simply as the properties "size" and "fontName"?  One thing is 
bothering me
though, you didn't show any forwards defined so how does your class
com.viador.rv.action.ApplyFormatAction do a return to get you to
"/mjsp.jsp"?  Are you doing some sort of redirect?

I haven't used DynaActionForms in a while but I think that your use 
of
"Form-Property" without extending from the class "DynaActionForm" 
is
giving
you the trouble.

Regards,
David
-Original Message-
From: Mu Mike [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 10, 2004 9:36 PM
To: [EMAIL PROTECTED]
Subject: RE: help me with using bean
David:

I did as you told and debugged the running process, the program 
certainlly
can run into the SelectFontForm class, but after stepping out of 
that
class
,it seems the program ended, the ApplyFormatAction code seems never 
been
called, what could be the cause of this?

Thanks&Regards

>From: "David Friedman" <[EMAIL PROTECTED]>
>Reply-To: "Struts Users Mailing List" 
<[EMAIL PROTECTED]>
>To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>Subject: RE: help me with using bean
>Date: Wed, 10 Mar 2004 21:24:54 -0500
>
>Mike,
>
>Why not change your:
>
> >public class SelectFontForm extends ActionForm{
> > public FontBean getBean() {
> > return bean;
> > }
>
>to:
>
> >public class SelectFontForm extends ActionForm{
> > public FontBean getBean() {
> >	// create a bean to give them IF the 'bean' is ever NULL!
> >	if ( bean == null )
> >bean = new FontBean();
> > return bean;
> > }
>
>Regards,
>David
>
>-Original Message-
>From: Mu Mike [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, March 10, 2004 9:16 PM
>To: [EMAIL PROTECTED]
>Subject: RE: help me with using bean
>
>
>David,
>Thank you, I m a newbie to struts, in  fact ,I dont know exactly 
what
kind
>of form should be there when I want to submit a bean, can you 
give me a
>more detailed description about how to submit a bean object? I 
think an
>example can better help me, since I really need to know something 
about
>this as soon as possible
>
>Thanks&Regards
>
>
> >From: "David Friedman" <[EMAIL PROTECTED]>
> >Reply-To: "Struts Users Mailing List" 
<[EMAIL PROTECTED]>
> >To: "Struts Users Mailing List" 
<[EMAIL PROTECTED]>
> >Subject: RE: help me with using bean
> >Date: Wed, 10 Mar 2004 20:50:18 -0500
> >
> >Mike,
> >
> >When you use form-property with a form-bean, don't you need to 
make
the
>main
> >Bean a DynaActionForm or a class you extended from 
DynaActionForm?
Where
>do
> >you initialize the form-property "bean".  For DynaActionForms, 
they
> >initialize to null, per "If you do not supply an initial 
attribute,
>numbers
> >will be initialized to 0 and objects to null" from the 
document:
>

http://jakarta.apache.org/struts/userGuide/building_controller.html#dyna_ac


>t
>
> >ion_form_classes
> >
> >Regards,
> >David
> >
> >-Original Message-
> >From: Mu M

RE: help me with using bean

2004-03-10 Thread Mu Mike
well, I said I was new because I began struts only a week ago and i have 
succefully submitted those 'primary' type values to an action. About the 
forward, I m using tiles tag in struts, StartPage.jsp is the first page I 
go to.

the tiles definition is the below

tiledef.xml


 
   



MainLayout.jsp

<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>


<%%>
<%%>


StartPage.jsp:
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>









From: "David Friedman" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Subject: RE: help me with using bean
Date: Wed, 10 Mar 2004 22:29:01 -0500
Mike,

You wrote are new to Struts so have you tried this without nesting a Bean
within a form?  I.E. by making an ActionForm which has "size" and 
"fontName"
properties then copying them if you need to use them somewhere else?  Then
you could access the properties not as "bean.size" and "bean.fontName" but
simply as the properties "size" and "fontName"?  One thing is bothering me
though, you didn't show any forwards defined so how does your class
com.viador.rv.action.ApplyFormatAction do a return to get you to
"/mjsp.jsp"?  Are you doing some sort of redirect?
I haven't used DynaActionForms in a while but I think that your use of
"Form-Property" without extending from the class "DynaActionForm" is 
giving
you the trouble.

Regards,
David
-Original Message-
From: Mu Mike [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 10, 2004 9:36 PM
To: [EMAIL PROTECTED]
Subject: RE: help me with using bean
David:

I did as you told and debugged the running process, the program certainlly
can run into the SelectFontForm class, but after stepping out of that 
class
,it seems the program ended, the ApplyFormatAction code seems never been
called, what could be the cause of this?
Thanks&Regards

>From: "David Friedman" <[EMAIL PROTECTED]>
>Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>Subject: RE: help me with using bean
>Date: Wed, 10 Mar 2004 21:24:54 -0500
>
>Mike,
>
>Why not change your:
>
> >public class SelectFontForm extends ActionForm{
> > public FontBean getBean() {
> > return bean;
> > }
>
>to:
>
> >public class SelectFontForm extends ActionForm{
> > public FontBean getBean() {
> >	// create a bean to give them IF the 'bean' is ever NULL!
> >	if ( bean == null )
> >bean = new FontBean();
> > return bean;
> > }
>
>Regards,
>David
>
>-Original Message-
>From: Mu Mike [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, March 10, 2004 9:16 PM
>To: [EMAIL PROTECTED]
>Subject: RE: help me with using bean
>
>
>David,
>Thank you, I m a newbie to struts, in  fact ,I dont know exactly what 
kind
>of form should be there when I want to submit a bean, can you give me a
>more detailed description about how to submit a bean object? I think an
>example can better help me, since I really need to know something about
>this as soon as possible
>
>Thanks&Regards
>
>
> >From: "David Friedman" <[EMAIL PROTECTED]>
> >Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> >To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> >Subject: RE: help me with using bean
> >Date: Wed, 10 Mar 2004 20:50:18 -0500
> >
> >Mike,
> >
> >When you use form-property with a form-bean, don't you need to make 
the
>main
> >Bean a DynaActionForm or a class you extended from DynaActionForm?
Where
>do
> >you initialize the form-property "bean".  For DynaActionForms, they
> >initialize to null, per "If you do not supply an initial attribute,
>numbers
> >will be initialized to 0 and objects to null" from the document:
>
http://jakarta.apache.org/struts/userGuide/building_controller.html#dyna_ac

>t
>
> >ion_form_classes
> >
> >Regards,
> >David
> >
> >-Original Message-
> >From: Mu Mike [mailto:[EMAIL PROTECTED]
> >Sent: Wednesday, March 10, 2004 8:31 PM
> >To: [EMAIL PROTECTED]
> >Subject: help me with using bean
> >
> >
> >I have files like the below,I m  trying to submit a bean object to my
> >action class, yet when I pressed the "submit" on the jsp file,it threw
an
> >exception:java.lang.IllegalArgume

RE: help me with using bean

2004-03-10 Thread David Friedman
Mike,

You wrote are new to Struts so have you tried this without nesting a Bean
within a form?  I.E. by making an ActionForm which has "size" and "fontName"
properties then copying them if you need to use them somewhere else?  Then
you could access the properties not as "bean.size" and "bean.fontName" but
simply as the properties "size" and "fontName"?  One thing is bothering me
though, you didn't show any forwards defined so how does your class
com.viador.rv.action.ApplyFormatAction do a return to get you to
"/mjsp.jsp"?  Are you doing some sort of redirect?

I haven't used DynaActionForms in a while but I think that your use of
"Form-Property" without extending from the class "DynaActionForm" is giving
you the trouble.

Regards,
David

-Original Message-
From: Mu Mike [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 10, 2004 9:36 PM
To: [EMAIL PROTECTED]
Subject: RE: help me with using bean


David:

I did as you told and debugged the running process, the program certainlly
can run into the SelectFontForm class, but after stepping out of that class
,it seems the program ended, the ApplyFormatAction code seems never been
called, what could be the cause of this?

Thanks&Regards

>From: "David Friedman" <[EMAIL PROTECTED]>
>Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>Subject: RE: help me with using bean
>Date: Wed, 10 Mar 2004 21:24:54 -0500
>
>Mike,
>
>Why not change your:
>
> >public class SelectFontForm extends ActionForm{
> > public FontBean getBean() {
> > return bean;
> > }
>
>to:
>
> >public class SelectFontForm extends ActionForm{
> > public FontBean getBean() {
> > // create a bean to give them IF the 'bean' is ever NULL!
> > if ( bean == null )
> >bean = new FontBean();
> > return bean;
> > }
>
>Regards,
>David
>
>-Original Message-
>From: Mu Mike [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, March 10, 2004 9:16 PM
>To: [EMAIL PROTECTED]
>Subject: RE: help me with using bean
>
>
>David,
>Thank you, I m a newbie to struts, in  fact ,I dont know exactly what kind
>of form should be there when I want to submit a bean, can you give me a
>more detailed description about how to submit a bean object? I think an
>example can better help me, since I really need to know something about
>this as soon as possible
>
>Thanks&Regards
>
>
> >From: "David Friedman" <[EMAIL PROTECTED]>
> >Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> >To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> >Subject: RE: help me with using bean
> >Date: Wed, 10 Mar 2004 20:50:18 -0500
> >
> >Mike,
> >
> >When you use form-property with a form-bean, don't you need to make the
>main
> >Bean a DynaActionForm or a class you extended from DynaActionForm?
Where
>do
> >you initialize the form-property "bean".  For DynaActionForms, they
> >initialize to null, per "If you do not supply an initial attribute,
>numbers
> >will be initialized to 0 and objects to null" from the document:
>
>http://jakarta.apache.org/struts/userGuide/building_controller.html#dyna_ac

>t
>
> >ion_form_classes
> >
> >Regards,
> >David
> >
> >-Original Message-
> >From: Mu Mike [mailto:[EMAIL PROTECTED]
> >Sent: Wednesday, March 10, 2004 8:31 PM
> >To: [EMAIL PROTECTED]
> >Subject: help me with using bean
> >
> >
> >I have files like the below,I m  trying to submit a bean object to my
> >action class, yet when I pressed the "submit" on the jsp file,it threw
an
> >exception:java.lang.IllegalArgumentException: No bean specified
> >
> >what is the correct way?
> >Thanks&Regards
> >
> >
> >myjsp.jsp
> >
> >html:form action="/selectFont.do" >
> > 
> > 
> >   
> > 
> > 
> >   
> > 
> > 
> > 
> >
> >
> >=
> >part of struts-config.xml
> >
> > 
> >  > type="com.viador.rv.form.SelectFontForm">
> >  >type="com.viador.rv.bean.FontBean"/>
> > 
> >  
> >
> > 
> >  > type="com.viador.rv.action.ApplyFormatAction"
> >

RE: help me with using bean

2004-03-10 Thread Mu Mike
David:
by the way, the setBean method in FontBean seems never been called, I think 
it should be called sometime during the running  process 


From: "Mu Mike" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: RE: help me with using bean
Date: Thu, 11 Mar 2004 02:36:07 +
David:

I did as you told and debugged the running process, the program 
certainlly can run into the SelectFontForm class, but after stepping 
out of that class ,it seems the program ended, the ApplyFormatAction 
code seems never been called, what could be the cause of this?

Thanks&Regards

From: "David Friedman" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" 
<[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Subject: RE: help me with using bean
Date: Wed, 10 Mar 2004 21:24:54 -0500

Mike,

Why not change your:

>public class SelectFontForm extends ActionForm{
> public FontBean getBean() {
> return bean;
> }
to:

>public class SelectFontForm extends ActionForm{
> public FontBean getBean() {
>// create a bean to give them IF the 'bean' is ever NULL!
>if ( bean == null )
>bean = new FontBean();
> return bean;
> }
Regards,
David
-Original Message-
From: Mu Mike [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 10, 2004 9:16 PM
To: [EMAIL PROTECTED]
Subject: RE: help me with using bean
David,
Thank you, I m a newbie to struts, in  fact ,I dont know exactly 
what kind
of form should be there when I want to submit a bean, can you give 
me a
more detailed description about how to submit a bean object? I 
think an
example can better help me, since I really need to know something 
about
this as soon as possible

Thanks&Regards

>From: "David Friedman" <[EMAIL PROTECTED]>
>Reply-To: "Struts Users Mailing List" 
<[EMAIL PROTECTED]>
>To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>Subject: RE: help me with using bean
>Date: Wed, 10 Mar 2004 20:50:18 -0500
>
>Mike,
>
>When you use form-property with a form-bean, don't you need to 
make the
main
>Bean a DynaActionForm or a class you extended from 
DynaActionForm?
Where
do
>you initialize the form-property "bean".  For DynaActionForms, 
they
>initialize to null, per "If you do not supply an initial 
attribute,
numbers
>will be initialized to 0 and objects to null" from the document:

http://jakarta.apache.org/struts/userGuide/building_controller.html#dyna_ac


t

>ion_form_classes
>
>Regards,
>David
>
>-Original Message-
>From: Mu Mike [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, March 10, 2004 8:31 PM
>To: [EMAIL PROTECTED]
>Subject: help me with using bean
>
>
>I have files like the below,I m  trying to submit a bean object 
to my
>action class, yet when I pressed the "submit" on the jsp file,it 
threw
an
>exception:java.lang.IllegalArgumentException: No bean specified
>
>what is the correct way?
>Thanks&Regards
>
>
>myjsp.jsp
>
>html:form action="/selectFont.do" >
> 
> 
>   
> 
> 
>   
> 
> 
> 
>
>
>=
>part of struts-config.xml
>
> 
> 
> type="com.viador.rv.form.SelectFontForm">
> 
>type="com.viador.rv.bean.FontBean"/>
> 
>  
>
> 
> 
> type="com.viador.rv.action.ApplyFormatAction"
> name="SelectFontForm"
> scope="session">
> 
>
>
>===
>SelectFontForm.java
>
>import org.apache.struts.action.ActionForm;
>import com.viador.rv.bean.FontBean;
>
>public class SelectFontForm extends ActionForm{
> public FontBean getBean() {
> return bean;
> }
>
> public void setBean(FontBean bean) {
> this.bean = bean;
> }
>
> private FontBean bean;
>}
>
>==
>FontBean.java
>
>public class FontBean  {
> public int getSize() {
> return size;
> }
>
> public void setSize(int size) {
> this.size = size;
> }
>
> public String getFontName() {
> return fontName;
> }
>
> public void setFontName(String fontName) {
> this.fontName = fontName;
> }
>
> private int size;
> private String fontName;
>
>}
>
>_
>享用世界上最大的电子邮件系统― MSN Hotmail。  
http://www.hotmail.com
>

RE: help me with using bean

2004-03-10 Thread Mu Mike
David:

I did as you told and debugged the running process, the program certainlly 
can run into the SelectFontForm class, but after stepping out of that class 
,it seems the program ended, the ApplyFormatAction code seems never been 
called, what could be the cause of this?

Thanks&Regards

From: "David Friedman" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Subject: RE: help me with using bean
Date: Wed, 10 Mar 2004 21:24:54 -0500
Mike,

Why not change your:

>public class SelectFontForm extends ActionForm{
> public FontBean getBean() {
> return bean;
> }
to:

>public class SelectFontForm extends ActionForm{
> public FontBean getBean() {
>// create a bean to give them IF the 'bean' is ever NULL!
>if ( bean == null )
>bean = new FontBean();
> return bean;
> }
Regards,
David
-Original Message-
From: Mu Mike [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 10, 2004 9:16 PM
To: [EMAIL PROTECTED]
Subject: RE: help me with using bean
David,
Thank you, I m a newbie to struts, in  fact ,I dont know exactly what kind
of form should be there when I want to submit a bean, can you give me a
more detailed description about how to submit a bean object? I think an
example can better help me, since I really need to know something about
this as soon as possible
Thanks&Regards

>From: "David Friedman" <[EMAIL PROTECTED]>
>Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>Subject: RE: help me with using bean
>Date: Wed, 10 Mar 2004 20:50:18 -0500
>
>Mike,
>
>When you use form-property with a form-bean, don't you need to make the
main
>Bean a DynaActionForm or a class you extended from DynaActionForm?  
Where
do
>you initialize the form-property "bean".  For DynaActionForms, they
>initialize to null, per "If you do not supply an initial attribute,
numbers
>will be initialized to 0 and objects to null" from the document:
http://jakarta.apache.org/struts/userGuide/building_controller.html#dyna_ac

t

>ion_form_classes
>
>Regards,
>David
>
>-Original Message-
>From: Mu Mike [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, March 10, 2004 8:31 PM
>To: [EMAIL PROTECTED]
>Subject: help me with using bean
>
>
>I have files like the below,I m  trying to submit a bean object to my
>action class, yet when I pressed the "submit" on the jsp file,it threw 
an
>exception:java.lang.IllegalArgumentException: No bean specified
>
>what is the correct way?
>Thanks&Regards
>
>
>myjsp.jsp
>
>html:form action="/selectFont.do" >
> 
> 
>   
> 
> 
>   
> 
> 
> 
>
>
>=
>part of struts-config.xml
>
> 
>  type="com.viador.rv.form.SelectFontForm">
> type="com.viador.rv.bean.FontBean"/>
> 
>  
>
> 
>  type="com.viador.rv.action.ApplyFormatAction"
> name="SelectFontForm"
> scope="session">
> 
>
>
>===
>SelectFontForm.java
>
>import org.apache.struts.action.ActionForm;
>import com.viador.rv.bean.FontBean;
>
>public class SelectFontForm extends ActionForm{
> public FontBean getBean() {
> return bean;
> }
>
> public void setBean(FontBean bean) {
> this.bean = bean;
> }
>
> private FontBean bean;
>}
>
>==
>FontBean.java
>
>public class FontBean  {
> public int getSize() {
> return size;
> }
>
> public void setSize(int size) {
> this.size = size;
> }
>
> public String getFontName() {
> return fontName;
> }
>
> public void setFontName(String fontName) {
> this.fontName = fontName;
> }
>
> private int size;
> private String fontName;
>
>}
>
>_
>享用世界上最大的电子邮件系统― MSN Hotmail。  http://www.hotmail.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: help me with using bean

2004-03-10 Thread David Friedman
Mike,

Why not change your:

>public class SelectFontForm extends ActionForm{
> public FontBean getBean() {
> return bean;
> }

to:

>public class SelectFontForm extends ActionForm{
> public FontBean getBean() {
>   // create a bean to give them IF the 'bean' is ever NULL!
>   if ( bean == null )
>bean = new FontBean();
> return bean;
> }

Regards,
David

-Original Message-
From: Mu Mike [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 10, 2004 9:16 PM
To: [EMAIL PROTECTED]
Subject: RE: help me with using bean


David,
Thank you, I m a newbie to struts, in  fact ,I dont know exactly what kind
of form should be there when I want to submit a bean, can you give me a
more detailed description about how to submit a bean object? I think an
example can better help me, since I really need to know something about
this as soon as possible

Thanks&Regards


>From: "David Friedman" <[EMAIL PROTECTED]>
>Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>Subject: RE: help me with using bean
>Date: Wed, 10 Mar 2004 20:50:18 -0500
>
>Mike,
>
>When you use form-property with a form-bean, don't you need to make the
main
>Bean a DynaActionForm or a class you extended from DynaActionForm?  Where
do
>you initialize the form-property "bean".  For DynaActionForms, they
>initialize to null, per "If you do not supply an initial attribute,
numbers
>will be initialized to 0 and objects to null" from the document:
>http://jakarta.apache.org/struts/userGuide/building_controller.html#dyna_ac
t

>ion_form_classes
>
>Regards,
>David
>
>-Original Message-
>From: Mu Mike [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, March 10, 2004 8:31 PM
>To: [EMAIL PROTECTED]
>Subject: help me with using bean
>
>
>I have files like the below,I m  trying to submit a bean object to my
>action class, yet when I pressed the "submit" on the jsp file,it threw an
>exception:java.lang.IllegalArgumentException: No bean specified
>
>what is the correct way?
>Thanks&Regards
>
>
>myjsp.jsp
>
>html:form action="/selectFont.do" >
> 
> 
>   
> 
> 
>   
> 
> 
> 
>
>
>=
>part of struts-config.xml
>
> 
>  type="com.viador.rv.form.SelectFontForm">
> type="com.viador.rv.bean.FontBean"/>
> 
>  
>
> 
>  type="com.viador.rv.action.ApplyFormatAction"
> name="SelectFontForm"
> scope="session">
> 
>
>
>===
>SelectFontForm.java
>
>import org.apache.struts.action.ActionForm;
>import com.viador.rv.bean.FontBean;
>
>public class SelectFontForm extends ActionForm{
> public FontBean getBean() {
> return bean;
> }
>
> public void setBean(FontBean bean) {
> this.bean = bean;
> }
>
> private FontBean bean;
>}
>
>==
>FontBean.java
>
>public class FontBean  {
> public int getSize() {
> return size;
> }
>
> public void setSize(int size) {
> this.size = size;
> }
>
> public String getFontName() {
> return fontName;
> }
>
> public void setFontName(String fontName) {
> this.fontName = fontName;
> }
>
> private int size;
> private String fontName;
>
>}
>
>_
>享用世界上最大的电子邮件系统― MSN Hotmail。  http://www.hotmail.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]
>

_
免费下载 MSN Explorer:   http://explorer.msn.com/lccn/


-
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: help me with using bean

2004-03-10 Thread Mu Mike
David,
Thank you, I m a newbie to struts, in  fact ,I dont know exactly what kind 
of form should be there when I want to submit a bean, can you give me a 
more detailed description about how to submit a bean object? I think an 
example can better help me, since I really need to know something about 
this as soon as possible

Thanks&Regards


From: "David Friedman" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Subject: RE: help me with using bean
Date: Wed, 10 Mar 2004 20:50:18 -0500
Mike,

When you use form-property with a form-bean, don't you need to make the 
main
Bean a DynaActionForm or a class you extended from DynaActionForm?  Where 
do
you initialize the form-property "bean".  For DynaActionForms, they
initialize to null, per "If you do not supply an initial attribute, 
numbers
will be initialized to 0 and objects to null" from the document:
http://jakarta.apache.org/struts/userGuide/building_controller.html#dyna_act

ion_form_classes

Regards,
David
-Original Message-
From: Mu Mike [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 10, 2004 8:31 PM
To: [EMAIL PROTECTED]
Subject: help me with using bean
I have files like the below,I m  trying to submit a bean object to my
action class, yet when I pressed the "submit" on the jsp file,it threw an
exception:java.lang.IllegalArgumentException: No bean specified
what is the correct way?
Thanks&Regards
myjsp.jsp

html:form action="/selectFont.do" >


  


  




=
part of struts-config.xml




 



   
===
SelectFontForm.java
import org.apache.struts.action.ActionForm;
import com.viador.rv.bean.FontBean;
public class SelectFontForm extends ActionForm{
public FontBean getBean() {
return bean;
}
public void setBean(FontBean bean) {
this.bean = bean;
}
private FontBean bean;
}
==
FontBean.java
public class FontBean  {
public int getSize() {
return size;
}
public void setSize(int size) {
this.size = size;
}
public String getFontName() {
return fontName;
}
public void setFontName(String fontName) {
this.fontName = fontName;
}
private int size;
private String fontName;
}

_
享用世界上最大的电子邮件系统― MSN Hotmail。  http://www.hotmail.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]
_
免费下载 MSN Explorer:   http://explorer.msn.com/lccn/  

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


RE: help me with using bean

2004-03-10 Thread David Friedman
Mike,

When you use form-property with a form-bean, don't you need to make the main
Bean a DynaActionForm or a class you extended from DynaActionForm?  Where do
you initialize the form-property "bean".  For DynaActionForms, they
initialize to null, per "If you do not supply an initial attribute, numbers
will be initialized to 0 and objects to null" from the document:
http://jakarta.apache.org/struts/userGuide/building_controller.html#dyna_act
ion_form_classes

Regards,
David

-Original Message-
From: Mu Mike [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 10, 2004 8:31 PM
To: [EMAIL PROTECTED]
Subject: help me with using bean


I have files like the below,I m  trying to submit a bean object to my
action class, yet when I pressed the "submit" on the jsp file,it threw an
exception:java.lang.IllegalArgumentException: No bean specified

what is the correct way?
Thanks&Regards


myjsp.jsp

html:form action="/selectFont.do" >


  


  





=
part of struts-config.xml





 




   

===
SelectFontForm.java

import org.apache.struts.action.ActionForm;
import com.viador.rv.bean.FontBean;

public class SelectFontForm extends ActionForm{
public FontBean getBean() {
return bean;
}

public void setBean(FontBean bean) {
this.bean = bean;
}

private FontBean bean;
}

==
FontBean.java

public class FontBean  {
public int getSize() {
return size;
}

public void setSize(int size) {
this.size = size;
}

public String getFontName() {
return fontName;
}

public void setFontName(String fontName) {
this.fontName = fontName;
}

private int size;
private String fontName;

}

_
享用世界上最大的电子邮件系统― MSN Hotmail。  http://www.hotmail.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: help ,action path

2004-03-10 Thread Mu Mike
now I know the reason, in after struts 1.1 ,which implements the idea of 
moudle configuration, you should not access a jsp page directly, you should 
use forward instead, for the first page(such as a login page) you may need 
to use tile definitions. By the way, where can I find a pdf book for 
guiding programming with struts 1.1

thank you all



From: "Mu Mike" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: RE: help ,action path
Date: Wed, 10 Mar 2004 05:46:16 +
of course, I m using an ide to edit the jsp page, it can hotly tell 
the errors in a jsp page
and I have struts.jar(1.1) in my library directory(web-inf/lib)



From: "Khalid K." <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" 
<[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Subject: RE: help ,action path
Date: Tue, 9 Mar 2004 21:41:30 -0800

Do you have the tag libraries defined on top of the page

Example:
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
???

Khalid



modified the jsp file to the below still doesnt work


or

You can also do a "view source" and look the html generated by tag

and ,I think I need an explaination of this, and what should be the 
right
way? (I think I m doing the right which I described in my last 
mail(below)
)

thank you all

>From: "Mu Mike" <[EMAIL PROTECTED]>
>Reply-To: "Struts Users Mailing List" 
<[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: help ,action path
>Date: Wed, 10 Mar 2004 03:18:51 +
>
>I got this jsp page:
>
>sample.jsp:
>
>
>
>  
>
>
>
>
>
>it is saved in
>
>/contextPath/rv/sample.jsp
>
>this is part of my web.xml
>
>web.xml:
>
>
>config/rv
>/WEB-INF/struts-rv-config.xml
>
>
>this is part of my struts-rv-config.xml
>
>struts-rv-config.xml:
>
>
>type="com.viador.rv.action.RunReportAction"
>name="OpenReportForm"
>scope="session">
>
>
>when I try to access the jsp page directly by this url
>http://localhost/myapp/rv/sample.jsp
>
>there is an error says
>Cannot retrieve mapping for action /openReport
>why?
>
>
>even when I modified the jsp page as the below
>
>action="/rv/openReport.do"> or action="myapp/rv/openReport.do
>
>it still doesnt work
>
>but if I use the form element of HTML instead of that of struts,
>smaple.jsp works!
>
>why is this?
>
>_
>与联机的朋友进行交流,请使用 MSN Messenger:
>http://messenger.msn.com/cn
>
>
>-
>To unsubscribe, e-mail: 
[EMAIL PROTECTED]
>For additional commands, e-mail: 
[EMAIL PROTECTED]
>

_
与联机的朋友进行交流,请使用 MSN Messenger:  
http://messenger.msn.com/cn

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



---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.594 / Virus Database: 377 - Release Date: 2/24/2004
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.594 / Virus Database: 377 - Release Date: 2/24/2004


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

_
享用世界上最大的电子邮件系统― MSN Hotmail。  http://www.hotmail.com
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
_
免费下载 MSN Explorer:   http://explorer.msn.com/lccn  

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


Re: help ,action path

2004-03-09 Thread Daniel Henrique Alves Lima
 The exception is been generated when .jsp is rendered (and not when you
submit the form), hum ?
Try to enable struts debug log (in your log4j config file) and try to
check the package/name of your action (in struts-config.xml)...


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



RE: help ,action path

2004-03-09 Thread Mu Mike
of course, I m using an ide to edit the jsp page, it can hotly tell the 
errors in a jsp page
and I have struts.jar(1.1) in my library directory(web-inf/lib)



From: "Khalid K." <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Subject: RE: help ,action path
Date: Tue, 9 Mar 2004 21:41:30 -0800
Do you have the tag libraries defined on top of the page

Example:
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
???

Khalid



modified the jsp file to the below still doesnt work


or

You can also do a "view source" and look the html generated by tag

and ,I think I need an explaination of this, and what should be the right
way? (I think I m doing the right which I described in my last mail(below)
)
thank you all

>From: "Mu Mike" <[EMAIL PROTECTED]>
>Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: help ,action path
>Date: Wed, 10 Mar 2004 03:18:51 +
>
>I got this jsp page:
>
>sample.jsp:
>
>
>
>  
>
>
>
>
>
>it is saved in
>
>/contextPath/rv/sample.jsp
>
>this is part of my web.xml
>
>web.xml:
>
>
>config/rv
>/WEB-INF/struts-rv-config.xml
>
>
>this is part of my struts-rv-config.xml
>
>struts-rv-config.xml:
>
>type="com.viador.rv.action.RunReportAction"
>name="OpenReportForm"
>scope="session">
>
>
>when I try to access the jsp page directly by this url
>http://localhost/myapp/rv/sample.jsp
>
>there is an error says
>Cannot retrieve mapping for action /openReport
>why?
>
>
>even when I modified the jsp page as the below
>
>action="/rv/openReport.do"> or action="myapp/rv/openReport.do
>
>it still doesnt work
>
>but if I use the form element of HTML instead of that of struts,
>smaple.jsp works!
>
>why is this?
>
>_
>与联机的朋友进行交流,请使用 MSN Messenger:
>http://messenger.msn.com/cn
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
_
与联机的朋友进行交流,请使用 MSN Messenger:  http://messenger.msn.com/cn
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.594 / Virus Database: 377 - Release Date: 2/24/2004
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.594 / Virus Database: 377 - Release Date: 2/24/2004


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
_
享用世界上最大的电子邮件系统― MSN Hotmail。  http://www.hotmail.com  

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


RE: help ,action path

2004-03-09 Thread Khalid K.
Do you have the tag libraries defined on top of the page

Example:
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>

???

Khalid



modified the jsp file to the below still doesnt work


or


You can also do a "view source" and look the html generated by tag


and ,I think I need an explaination of this, and what should be the right 
way? (I think I m doing the right which I described in my last mail(below)  
)

thank you all

>From: "Mu Mike" <[EMAIL PROTECTED]>
>Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: help ,action path
>Date: Wed, 10 Mar 2004 03:18:51 +
>
>I got this jsp page:
>
>sample.jsp:
>
>
>
>  
>
>
>
>
>
>it is saved in
>
>/contextPath/rv/sample.jsp
>
>this is part of my web.xml
>
>web.xml:
>
>
>config/rv
>/WEB-INF/struts-rv-config.xml
>
>
>this is part of my struts-rv-config.xml
>
>struts-rv-config.xml:
>
>type="com.viador.rv.action.RunReportAction"
>name="OpenReportForm"
>scope="session">
>
>
>when I try to access the jsp page directly by this url 
>http://localhost/myapp/rv/sample.jsp
>
>there is an error says
>Cannot retrieve mapping for action /openReport
>why?
>
>
>even when I modified the jsp page as the below
>
>action="/rv/openReport.do"> or action="myapp/rv/openReport.do
>
>it still doesnt work
>
>but if I use the form element of HTML instead of that of struts,
>smaple.jsp works!
>
>why is this?
>
>_
>与联机的朋友进行交流,请使用 MSN Messenger:
>http://messenger.msn.com/cn
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>

_
与联机的朋友进行交流,请使用 MSN Messenger:  http://messenger.msn.com/cn  


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



---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.594 / Virus Database: 377 - Release Date: 2/24/2004
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.594 / Virus Database: 377 - Release Date: 2/24/2004
 


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



Re: help ,action path

2004-03-09 Thread Daniel Henrique Alves Lima
 Sorry, my mistake.
When you use "view source" of your browser, how does the html code look
like ?


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



RE: help ,action path

2004-03-09 Thread Mu Mike
modified the jsp file to the below still doesnt work


or

You can also do a "view source" and look the html generated by tag

and ,I think I need an explaination of this, and what should be the right 
way? (I think I m doing the right which I described in my last mail(below)  
)

thank you all

From: "Mu Mike" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: help ,action path
Date: Wed, 10 Mar 2004 03:18:51 +
I got this jsp page:

sample.jsp:

   
   
 
   
   
   

it is saved in

/contextPath/rv/sample.jsp

this is part of my web.xml

web.xml:

   
   config/rv
   /WEB-INF/struts-rv-config.xml
   
this is part of my struts-rv-config.xml

struts-rv-config.xml:

   
   
when I try to access the jsp page directly by this url
http://localhost/myapp/rv/sample.jsp
there is an error says
Cannot retrieve mapping for action /openReport
why?
even when I modified the jsp page as the below

action="/rv/openReport.do"> or action="myapp/rv/openReport.do

it still doesnt work

but if I use the form element of HTML instead of that of struts, 
smaple.jsp works!

why is this?

_
与联机的朋友进行交流,请使用 MSN Messenger:  
http://messenger.msn.com/cn

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
_
与联机的朋友进行交流,请使用 MSN Messenger:  http://messenger.msn.com/cn  

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


Re: help ,action path

2004-03-09 Thread Daniel Henrique Alves Lima
Please, try


or


You can also do a "view source" and look the html generated by tag





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



RE: Help on mapping multiple records with formbean.

2004-03-04 Thread Andrew Hill
Do not cross-post to the developer list like that.
http://www.catb.org/~esr/faqs/smart-questions.html
The developer list is not the place to post user questions.


Have you looked at the keyboard monkey tutorial yet?
http://www.k [LINK CENSORED FOR CROSSPOSTING.]

;->





oh all right...
here it is:
http://www.keyboardmonkey.com/next/index.jsp


-Original Message-
From: Venkata Aleti [mailto:[EMAIL PROTECTED]
Sent: Thursday, 4 March 2004 23:44
To: 'Struts Developers List'; Venkata Aleti
Cc: '[EMAIL PROTECTED]'
Subject: Help on mapping multiple records with formbean.


Hi
I have a view that include multiple editable rows , each row represents
Employee information.
Here view contains any number of rows, its dynamic. Now I want map this view
to form bean so that I can
Validate the user inputs and display error messages if any errors exist .
Right now I have one solution providing index properties in the view.

Please can you help me with the examples.



View



|name | age |empno| deptno |Description |

|scott| 23  |100  | 10 ||

|peter| 33  |200  | 10 ||

|sunny| 34  |300  | 40 ||

|reddy| 24  |400  | 30 ||

|tom  | 56  |500  | 10 ||
-

  -
 | Submit  |
  -

Thank you.
Regards
Venkata Aleti


-
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: Help on ApplicationResources

2004-03-04 Thread Todd G. Nist
Kamakshya,

There is an implementation of this available at
http://sourceforge.net/project/showfiles.php?group_id=49385.

Go to the above site and about halfway down the page you will find a project
category called:
MessageResources Impls 

Under this you will find a package called:

ojb-msg-resources

You can download it along with the demo application to see how to apply it
to your application.

HTH,

Todd

-Original Message-
From: Prasad, Kamakshya [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 04, 2004 12:23 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Help on ApplicationResources


Hi All,
 
We are using struts framework for building an application for a client.
In the system, the client wants to have all the error messages, labels
etc in the database instead of having them in a properties file. Please
let me know that how can we extend the necessary packages provided by
struts with a minimal changes and with the ability to continue using the
normal functionalities provided by struts like , errors,
ActionErrors etc.
 
Thanks and Regards,
Kamakshya 
 


begin 666 winmail.dat
M>)\^(A4.`0:0" `$```!``$``0>[EMAIL PROTECTED](Y 0```#H``$(@ <`
M& ```$E032Y-:6-R;[EMAIL PROTECTED];"Y.;W1E`#$(`0V ! `"[EMAIL PROTECTED]"``$&
M@ ,[EMAIL PROTECTED]'[EMAIL PROTECTED] &`- (```H"P`"``$+
M`",```,`)@``"P`I```#`"X```,[EMAIL PROTECTED]'@!P``$`
M```=2&5L<"!O;B!!<'!L:6-A=&EO;E)E01"F(X4NFB0J*$0'VV<* ```#`!0.`0L`
M'[EMAIL PROTECTED])$ $4! ``$ 0``#H&``!,6D9U.D9'= ,`"@!R8W!G,3(U
MXC(#0W1E> 5!`0,!]_\*@ *D`^0'$P* #_,`4 16/PA5![(1)0Y1`P$"`&-H
MX0K $>8![0!N!>=AZ0`) .L![19"9B=0,A,0= 9G=A>2!D
[EMAIL PROTECTED] F,@JP(E @>[EMAIL PROTECTED] #\&P#(". )S(HP"+4Y"!C'Z!E9P6P*" JH'LI
M@ F .AV5`9$%T >0<]THX5('D"'3!"!)'R$$(7T=J54G,!*!(#,I+P#0:P\H
[EMAIL PROTECTED]&(M;7/<9RT8("SE'9I9*3$JH/<#H"A"%[!A)T FX![0%[#\;F ?I"8!%! >D"-1_R7R-H(H(#41)@$O,07 -HGQ
M)0M([EMAIL PROTECTED] 1P"S$=N.HM/+)/!1!G"X '0"Q&"SRS'91&`V$Z(%!RDF$L@&0L
M'.@@6P# LP,0)@`Z:R+ /S) *J#.<";@!T 4$')V#> +@([EMAIL PROTECTED]@+FIP71V4
[EMAIL PROTECTED] ^\!Y0"'!S9"@0C3]P30K $] @,#0_<(L!T$1@( [EMAIL PROTECTED](S$,!&33M6
M/O!S='(GD'/B+0$`=D!J'2 *P &0KBXV@ #0'F N(C$[1@:>=4&A1K\B0$*E
M=6(B\F$^\$AE;' ?\ [EMAIL PROTECTED]>\VF"S',2LZ9&D0P"F '87]+;57(0$>@[EMAIL PROTECTED]&
M!2F@:[EMAIL PROTECTED];!K*: %L6+Z=0,09$^"[EMAIL PROTECTED]:P'W$E!4DH='-Y
M_T80'U _<"8R4O0I4 !P4 '_)@$3X":A*T$F(P20`V %P/L'@2R"D0" [EMAIL PROTECTED](F,6U8LKTJ`W $D!^P
[EMAIL PROTECTED]'90?0 5 !X @:[YN-\(3X"$Q-\$T0G=6H?\.T GP)T F
M,B* +2$L@"L!/S U!" BP4'0`0`G0&)Y[QV43\4UHRH`;0N !W ]8?\3T35P
M!Y$G(C6G`: #$";@_R@@)@$%H (P"X *4$]5)C&+'91=T')C(F9U;B,0?Q_!
M!T FX%OR8/E/MC:P:ZT>D#Q7X !P.E9PL1:R8_F$XK?7"0'@!"$ $```!+/$,R-3)$
[EMAIL PROTECTED]"0S8P0D1",T,Q,S!$1$8P03(R.3)&0&-A<&ET86PM;[EMAIL PROTECTED]
M8V%P:71A;'-E`#. "" &``# 
[EMAIL PROTECTED] `"P`T@ @@[EMAIL PROTECTED] ```$8`
M!H4+`#B "" &``# [EMAIL PROTECTED],`.8 (
M( 8``, ```!&`!&%`P`[@ @@[EMAIL PROTECTED] ``
M`$8`&(4>`$F "" &``# [EMAIL PROTECTED]
M``$`'@!*@ @@[EMAIL PROTECTED] ```$8`-X4```$!
M`!X`2X (( 8``, ```!&`#B%```!`0`"
M`?@/`0```! ```"SIY!$*8CA2Z:)"HH1`?;9`@'Z#P$0LZ>01"F(
MX4NFB0J*$0'VV0(!^P\!DP`XH;L0!>40&J&[" `K*E;"``!M
M

Re: Help on ApplicationResources

2004-03-04 Thread Niall Pemberton
Kamakshya,

I answered this message, but I didn't notice you had posted this to both the
struts-dev AND struts-user list and the reply address defaulted to
struts-dev, so my answer went there.

First of all, you need to post messages to the appropriate list - this is a
user question, so it never should have been posted to struts-dev.
Secondly you posted the same message to two lists - "cross posting". The
jakarta guidelines, which you are asked to read before subscribing, clearly
states "Do not cross post messages".

Both of these issues are covered in the Jakarta guidelines for mailing
lists:

http://jakarta.apache.org/site/mail.html


Its in your interest to follow these guidelines as ignoring them is likely
to anoy people and you are less likely to get any help.

My earlier reply was ...

 Struts is designed to do eactly this. You can provide your own
 implementations of the MessageResources and MessageResourcesFactory classes
 and plug them in. Look at the javadoc for the "org.apache.struts.util"
 package - it has a good section on "Message Resources" telling you what you
 need to know.

 http://jakarta.apache.org/struts/api/index.html

 Niall

- Original Message - 
From: "Prasad, Kamakshya" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, March 04, 2004 5:22 AM
Subject: Help on ApplicationResources


Hi All,

We are using struts framework for building an application for a client.
In the system, the client wants to have all the error messages, labels
etc in the database instead of having them in a properties file. Please
let me know that how can we extend the necessary packages provided by
struts with a minimal changes and with the ability to continue using the
normal functionalities provided by struts like , errors,
ActionErrors etc.

Thanks and Regards,
Kamakshya




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



Re: help with xml syntax of JSP with taglibs

2004-02-09 Thread Kris Schneider
Quick try - what about something like this:


  @import url();


Otherwise, how 'bout using regular JSP syntax for bar.jsp ;-)? Or, if you're
using JSP 2.0, it's pretty easy to do. If none of those work/apply, here's
something goofy for your entertainment:

http://java.sun.com/jstl/core";
  xmlns:x="http://java.sun.com/jstl/xml";
  xmlns:jsp="http://java.sun.com/JSP/Page";
  version="1.2">



http://www.w3.org/1999/XSL/Transform";>











  












Obviously, it makes more sense for the stylesheet to be an independent/external
file...

Quoting Larry Meadors <[EMAIL PROTECTED]>:

> can you use the jstl xml tags to do that? I am guessing you can, but
> don't have time now to look it up...
> 
> LArry
> 
> >>> [EMAIL PROTECTED] 02/05/04 1:57 PM >>>
> Hello...
> 
> I have a file called /foo/bar.jsp.
> 
> The file bar.jsp is an XML syntax JSP.  The file is only being used by a
> 'forward' therefore the URL in the browser window stays the same (for
> example: http://localhost/webapp/index.jsp).
> 
> index.jsp forwards to /foo/bar.jsp like this:
> 
> 
> 
> Bar.jsp requires the use of a CSS that is located in "/css/main.css"
>  I refer to the css in the XML JSP like this:
> 
> 
> The problem is that /css/main.css is not valid!  It does not generate
> the
> proper path!   I have been advised to use this instead:
>  ="text/css"/>
> 
> The problem is that the this does not work since it is not valid XML.
> 
> Am I missing something here?  How do I refer to a stylesheet in a JSP
> (that
> will only be used by forward's) and maintain the proper paths
> 
> Does the html or any other taglib do this for me???
> 
> Thanks in advance for the help!
> 
> TJ Herring
> [EMAIL PROTECTED]

-- 
Kris Schneider 
D.O.Tech   

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



Re: help with xml syntax of JSP with taglibs

2004-02-05 Thread Larry Meadors
can you use the jstl xml tags to do that? I am guessing you can, but
don't have time now to look it up...

LArry

>>> [EMAIL PROTECTED] 02/05/04 1:57 PM >>>
Hello...

I have a file called /foo/bar.jsp.

The file bar.jsp is an XML syntax JSP.  The file is only being used by a
'forward' therefore the URL in the browser window stays the same (for
example: http://localhost/webapp/index.jsp).

index.jsp forwards to /foo/bar.jsp like this:



Bar.jsp requires the use of a CSS that is located in "/css/main.css"
 I refer to the css in the XML JSP like this:


The problem is that /css/main.css is not valid!  It does not generate
the
proper path!   I have been advised to use this instead:


The problem is that the this does not work since it is not valid XML.

Am I missing something here?  How do I refer to a stylesheet in a JSP
(that
will only be used by forward's) and maintain the proper paths

Does the html or any other taglib do this for me???

Thanks in advance for the help!

TJ Herring
[EMAIL PROTECTED]




The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited. If you
received
this in error, please contact the sender and delete the material from
any
computer.



-
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: Help URL Rewriting

2004-01-26 Thread Michael E. Allen
Christian Bollmeyer wrote:
Am Freitag, 23. Januar 2004 19:59 schrieb Michael E. Allen:

Where would I put that?


Already tried putting it in the <%@ page [..] %> on top of
your JSP pages? :-) As Struts tends to create a session implicitly,
such as for storing the default locale settings etc, doing so 
in the end would show no real effect anyway (provided that
you're not doing direct JSP calls, but wrap them into a 
standard Struts forward action at least, which is definitely 
recommendable).

Considering the URL rewriting issue: just yesterday I
wrote about enforcing Cookies (for certain parts of
the application that won't work otherwise, among
these those invoking external systems written in
other languages inside a session-wide transaction),
so I better refer to that post here. Normally,
supporting URL rewriting is definitely a good
thing, and you shouldn't suppress this fine
mechanism unless you have to. If you have to,
still, you can always say session.invalidate()
and do a normal forward, in a custom Action.
HTH,
-- Chris.


Anyway... I ended up doing a double redirect... the first to get the
cookie set and the second to get the URL without the "?JSESSION=xxx"
stuff appended.
Eric Bariaux wrote:

What about session=false on your jsp page directive? Would this
help? Eric.

-Original Message-
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Michael E.
Allen Sent: Thursday, January 22, 2004 10:37 PM
To: [EMAIL PROTECTED]
Subject: Re: Help URL Rewriting
Ted Husted wrote:

The container can't be sure that any given client supports
cookies,
so


it will always use URL rewriting on the first request.
Is there any way to shut that off?  From and Action I am returning
an ActionForward from the execute that maps to an jnlp file.  The
"?jsessionid=090280243" at the end is messing up starting java web
start.  I can tell me users to hit refresh once and it will go
away... but there should be a better way!
I am not using jsp... the page I want to forward to is a jnlp file (java 
web start), so there is no jsp directive in that file.  I am not a jsp 
programmer, so I thought perhaps there was a configuration file somewhere.

In any case, neither setting session=false nor calling 
session.invalidate() will do what I want; because I *do*, in fact, want 
there to be a session.  I just don't want the JSESSIONID appended to the 
url on the first call.



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


Re: Help URL Rewriting

2004-01-23 Thread Christian Bollmeyer
Am Freitag, 23. Januar 2004 19:59 schrieb Michael E. Allen:
> Where would I put that?

Already tried putting it in the <%@ page [..] %> on top of
your JSP pages? :-) As Struts tends to create a session implicitly,
such as for storing the default locale settings etc, doing so 
in the end would show no real effect anyway (provided that
you're not doing direct JSP calls, but wrap them into a 
standard Struts forward action at least, which is definitely 
recommendable).

Considering the URL rewriting issue: just yesterday I
wrote about enforcing Cookies (for certain parts of
the application that won't work otherwise, among
these those invoking external systems written in
other languages inside a session-wide transaction),
so I better refer to that post here. Normally,
supporting URL rewriting is definitely a good
thing, and you shouldn't suppress this fine
mechanism unless you have to. If you have to,
still, you can always say session.invalidate()
and do a normal forward, in a custom Action.

HTH,
-- Chris.


> Anyway... I ended up doing a double redirect... the first to get the
> cookie set and the second to get the URL without the "?JSESSION=xxx"
> stuff appended.
>
> Eric Bariaux wrote:
> > What about session=false on your jsp page directive? Would this
> > help? Eric.
> >
> >>-Original Message-
> >>From: news [mailto:[EMAIL PROTECTED] On Behalf Of Michael E.
> >> Allen Sent: Thursday, January 22, 2004 10:37 PM
> >>To: [EMAIL PROTECTED]
> >>Subject: Re: Help URL Rewriting
> >>
> >>Ted Husted wrote:
> >>>The container can't be sure that any given client supports
> >>> cookies,
> >
> > so
> >
> >>>it will always use URL rewriting on the first request.
> >>
> >>Is there any way to shut that off?  From and Action I am returning
> >> an ActionForward from the execute that maps to an jnlp file.  The
> >> "?jsessionid=090280243" at the end is messing up starting java web
> >> start.  I can tell me users to hit refresh once and it will go
> >> away... but there should be a better way!
> >>
> >>Thanks,
> >>Michael
> >>
> >>
> >>
> >>---
> >>-- 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: Help URL Rewriting

2004-01-23 Thread Michael E. Allen
Where would I put that?

Anyway... I ended up doing a double redirect... the first to get the 
cookie set and the second to get the URL without the "?JSESSION=xxx" 
stuff appended.

Eric Bariaux wrote:
What about session=false on your jsp page directive? Would this help?
Eric.

-Original Message-
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Michael E. Allen
Sent: Thursday, January 22, 2004 10:37 PM
To: [EMAIL PROTECTED]
Subject: Re: Help URL Rewriting
Ted Husted wrote:

The container can't be sure that any given client supports cookies,
so

it will always use URL rewriting on the first request.

Is there any way to shut that off?  From and Action I am returning an
ActionForward from the execute that maps to an jnlp file.  The
"?jsessionid=090280243" at the end is messing up starting java web
start.  I can tell me users to hit refresh once and it will go away...
but there should be a better way!
Thanks,
Michael


-
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: Help URL Rewriting

2004-01-22 Thread Eric Bariaux
What about session=false on your jsp page directive? Would this help?
Eric.

> -Original Message-
> From: news [mailto:[EMAIL PROTECTED] On Behalf Of Michael E. Allen
> Sent: Thursday, January 22, 2004 10:37 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Help URL Rewriting
> 
> Ted Husted wrote:
> > The container can't be sure that any given client supports cookies,
so
> > it will always use URL rewriting on the first request.
> >
> 
> Is there any way to shut that off?  From and Action I am returning an
> ActionForward from the execute that maps to an jnlp file.  The
> "?jsessionid=090280243" at the end is messing up starting java web
> start.  I can tell me users to hit refresh once and it will go away...
> but there should be a better way!
> 
> Thanks,
> Michael
> 
> 
> 
> -
> 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: Help URL Rewriting

2004-01-22 Thread Michael E. Allen
Ted Husted wrote:
The container can't be sure that any given client supports cookies, so 
it will always use URL rewriting on the first request.

Is there any way to shut that off?  From and Action I am returning an 
ActionForward from the execute that maps to an jnlp file.  The 
"?jsessionid=090280243" at the end is messing up starting java web 
start.  I can tell me users to hit refresh once and it will go away... 
but there should be a better way!

Thanks,
Michael


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


RE: Help: messagesPresent = true if JSP is served from ActionServlet

2004-01-22 Thread Chris Wall
Hey Rick.  Thanks for your reply.

I found the same behavior to be true in Struts' sample validation example
(struts-validator.war) contained w/in the Strut 1.1 distribution.  If you go
to http://localhost:7001/struts-validator/registration.do the "Validation
Error" section is displayed inappropriately.  If you go to
http://localhost:7001/struts-validator/registration.jsp, the JSP is rendered
cleanly ready for user input.

See response to questions/comments below...

-Original Message-
From: Richard Hightower [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 22, 2004 9:56 AM
To: Struts Users Mailing List; [EMAIL PROTECTED]
Subject: RE: Help: messagesPresent = true if JSP is served from
ActionServlet

comments below


Rick Hightower
Developer

Struts/J2EE training -- http://www.arc-mind.com/strutsCourse.htm

Struts/J2EE consulting --
http://www.arc-mind.com/consulting.htm#StrutsMentoring

-Original Message-
From: Chris Wall [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 22, 2004 10:22 AM
To: [EMAIL PROTECTED]
Subject: Help: messagesPresent = true if JSP is served from
ActionServlet

Hey there.

Noticed that messagesPresent is TRUE when a JSP is served from an
ActionServlet.  This causes logic within  to be executed-
for example validation errors are inappropriately displayed.  This works
fine if the JSP is render directly, but a common practice is for all web
navigation to flow in and out of ActionServlets.


 I have never seen this happen before. How long have you been using
Struts? (This is not a jab but a serious question.)
[CHRIS] About 1.5 years now.  Implemented a Struts 1.0 application.
Upgrading that application to Struts 1.1.  Included in that is upgrading the
validation to use Strut's XML-based validation.

 MVC/Model 2 requires that requests go throught the controller, and the
controller selects the next view.
[CHRIS]  Yes, we follow this pattern.  That's why I'm curious as to why
 is true when a controller (LookupDispatchAction in my
case) renders a JSP.  Seems like I'm not breaking new ground here.

*** What are the error messages?
[CHRIS] There are no Struts error messages, per se.  The errors displayed
are validation errors.  When the page first loads, since all form fields are
blank, validation errors shown are "blah is required".

*** Which class in the system saves those error messages in the first place?
an ActionForm? an Action? a Custom RequestProcessor?
[CHRIS] Dunno for sure.  This is all handled within the framework.  I would
assume that validation handles instantiating and populating ActionMessages
and ActionErrors and attaching them to the request.

*** Typically only ActionForms and Actions genereate error messages.
[CHRIS] My situation is a form within a JSP, ValidatorForm, and
LookupDispatchAction working together.

*** Suggestions:
*** Look at the message. Look in the resource bundle. Find the key
associated with the message. Grep your source for the key to see who is
putting the message in.
[CHRIS] The validation error messages being displayed are the error messages
associated with the default error tags within ApplicationResources.  For
example "errors.required".


I'm assuming that this is happening because the request contains either
ActionMessages or ActionErrors or both.  I tried setting both to null within
the ActionServer before rendering the JSP (saveMessages(request, null); and
saveErrors(request, null);), but that did not work.  Argh.


*** Explain this. What is the ActionServer?
[CHRIS] The ActionServlet is actually a LookupDispatchAction.  I guess I
meant to say just Action class.  The struts-validator example's
RegistrationAction extends Action.  The struts-validator example produces
the same behavior.

*** Do you mean you do this in an Action? RequestProcessor? or did you
override the ActionServlet?
[CHRIS] We extend LookupDispatchAction and Action only.

*** When do you do this?


How can I resolve this?  Thanks.

*** I gave some pointers above. Turn on logging to a high level using
commons logging.
[CHRIS] The contents of the request are as follows:
weblogic.servlet.network_channel.port=7001
weblogic.servlet.network_channel.sslport=7002
org.apache.struts.action.MESSAGE=org.apache.struts.util.PropertyMessageResou
[EMAIL PROTECTED]
[EMAIL PROTECTED]
org.apache.struts.action.mapping.instance=ActionConfig[path=/register,input=
/Register.jsp,name=registrationBean,paramete
r=action,scope=request,type=com.bea.medrec.actions.RegisterAction
[EMAIL PROTECTED]
org.apache.struts.action.MODULE=org.apache.struts.config.impl.ModuleConfigIm
[EMAIL PROTECTED]


- Chris




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



RE: Help: messagesPresent = true if JSP is served from ActionServlet

2004-01-22 Thread Richard Hightower
comments below


Rick Hightower
Developer

Struts/J2EE training -- http://www.arc-mind.com/strutsCourse.htm

Struts/J2EE consulting --
http://www.arc-mind.com/consulting.htm#StrutsMentoring

-Original Message-
From: Chris Wall [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 22, 2004 10:22 AM
To: [EMAIL PROTECTED]
Subject: Help: messagesPresent = true if JSP is served from
ActionServlet


Hey there.



Noticed that messagesPresent is TRUE when a JSP is served from an
ActionServlet.  This causes logic within  to be executed-
for example validation errors are inappropriately displayed.  This works
fine if the JSP is render directly, but a common practice is for all web
navigation to flow in and out of ActionServlets.


 I have never seen this happen before. How long have you been using
Struts? (This is not a jab but a serious question.)
 MVC/Model 2 requires that requests go throught the controller, and the
controller selects the next view.

*** What are the error messages?
*** Which class in the system saves those error messages in the first place?
an ActionForm? an Action? a Custom RequestProcessor?
*** Typically only ActionForms and Actions genereate error messages.

*** Suggestions:
*** Look at the message. Look in the resource bundle. Find the key
associated with the message. Grep your source for the key to see who is
putting the message in.



I'm assuming that this is happening because the request contains either
ActionMessages or ActionErrors or both.  I tried setting both to null within
the ActionServer before rendering the JSP (saveMessages(request, null); and
saveErrors(request, null);), but that did not work.  Argh.


*** Explain this. What is the ActionServer?
*** Do you mean you do this in an Action? RequestProcessor? or did you
override the ActionServlet?
*** When do you do this?




How can I resolve this?  Thanks.

*** I gave some pointers above. Turn on logging to a high level using
commons logging.

- Chris



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



RE: Help needed in form beans

2003-12-18 Thread Robert Taylor
You may want to consider creating a separate object to hold these
values in the session and use your form beans for data input.
This way you can decide when to populate your form beans with
the data that you've captured in the session. 

To control when reset() affects my form properties I subclassed
the action form and subclassed ActionMapping to add an isReset()
setReset(boolean reset) methods so I can declaratively define
when reset is to be used by adding the following line in my struts-config
file:



robert

> -Original Message-
> From: vasudevrao gupta [mailto:[EMAIL PROTECTED]
> Sent: Thursday, December 18, 2003 12:30 AM
> To: 'Struts Users Mailing List'
> Subject: Help needed in form beans
> 
> 
> 
> Hi All,
> 
> I have a same form bean for 5 JSP's(JSP1,JSP2,JSP3,JSP4,JSP5)
> 
> All the JSP's use the same form bean.I am keeping the form bean in the
> session scope.
> 
> When ever I use JSP1, JSP3, I want to see the blank screen even if there
> are some values in the formbean.
> But, in other JSP's, I want to see the screen with prepopulated values.
> I tried using reset() for this and I have set all the values in formbean
> to null.But reset is getting called 
> for all the action.I want reset to be called only for JSP1,JSP3.
> 
> Please provide any direction on this
> 
> Regards
> VasudevRaoGupta
> 
> 
> Confidentiality Notice 
> 
> The information contained in this electronic message and any 
> attachments to this message are intended
> for the exclusive use of the addressee(s) and may contain 
> confidential or privileged information. If
> you are not the intended recipient, please notify the sender at 
> Wipro or [EMAIL PROTECTED] immediately
> and destroy all copies of this message and any attachments.
> 
> -
> 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: Help on form reset

2003-12-17 Thread Martin Gainty
Any Form Bean which extends ActionForm can override the reset() method
http://www.fawcette.com/javapro/2002_07/online/kjones/default_pf.aspx
Is there something in particular you wish to accomplish?

Martin

- Original Message - 
From: "Fullam, Jonathan" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Wednesday, December 17, 2003 9:11 AM
Subject: RE: Help on form reset


> No, the reset method will automatically be called on a Session scoped
> ActionForm upon each request.  Request scoped ActionForms are newly
> instantiated upon each request so, with Request scoped ActionForms, the
> reset method is irrelevant.
> -Jonathan
>
> -Original Message-
> From: vasudevrao gupta [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, December 17, 2003 9:06 AM
> To: 'Struts Users Mailing List'
> Subject: Help on form reset
>
>
>
> Hi,
>
> I am new to struts..
> I understand that the validate method of the Action form can be called
> based on the "validate"
> attribute in struts_config.xml.
> Similarly, for the reset method, can we configure in the xml file.
>
> Regards
> VasudevRaoGupta
>
>
> Confidentiality Notice
>
> The information contained in this electronic message and any attachments
to
> this message are intended
> for the exclusive use of the addressee(s) and may contain confidential or
> privileged information. If
> you are not the intended recipient, please notify the sender at Wipro or
> [EMAIL PROTECTED] immediately
> and destroy all copies of this message and any attachments.
>
> -
> 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: Help on form reset

2003-12-17 Thread Fullam, Jonathan
No, the reset method will automatically be called on a Session scoped
ActionForm upon each request.  Request scoped ActionForms are newly
instantiated upon each request so, with Request scoped ActionForms, the
reset method is irrelevant.
-Jonathan

-Original Message-
From: vasudevrao gupta [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 17, 2003 9:06 AM
To: 'Struts Users Mailing List'
Subject: Help on form reset



Hi,

I am new to struts..
I understand that the validate method of the Action form can be called
based on the "validate" 
attribute in struts_config.xml.
Similarly, for the reset method, can we configure in the xml file.

Regards
VasudevRaoGupta


Confidentiality Notice 

The information contained in this electronic message and any attachments to
this message are intended
for the exclusive use of the addressee(s) and may contain confidential or
privileged information. If
you are not the intended recipient, please notify the sender at Wipro or
[EMAIL PROTECTED] immediately
and destroy all copies of this message and any attachments.

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


RE: Help Req : Loading init params

2003-12-12 Thread Ben Anderson
you're getting the NullPointerException because getServlet() is returning 
null.  This is because setServlet hasn't been called by Struts yet.  From 
the javadoc for Action:

When an Action instance is first created, the controller servlet will call 
setServlet() with a non-null argument to identify the controller servlet 
instance to which this Action is attached.

So, the code inside an Action's constructor is executed before this happens. 
 I personally don't know if there's a better way to do what you're trying 
to do.  Why don't you like the way it's currently being done?

-Ben


From: "Shakti" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
CC: <[EMAIL PROTECTED]>
Subject: Help Req : Loading init params
Date: Fri, 12 Dec 2003 19:01:24 +0530
Hi All,
We are using weblogic7.1 struts 1.0 version.We are storing all application 
specific parameters in web.xml file.Hence in order to get that value we use 
following code in each action class :
getServlet().getInitParameter("INIT_PARAM")

Instead of this what I thought is we can have a common Parent action class 
which would load all this paramters and store them as it's attributes.
eg.

public class ParentAction extends DispatchAction
{
protected String INIT_PARAM = "";
public ParentAction ()
{
 INIT_PARAM =
getServlet().getInitParameter("INIT_PARAM");
}
}
Other action classes would extend this class instead of extending 
DispathAction class directly.
But when I try to get the value of init param in subclasses of parent 
action class it gives me an error.

public class LoginAction extends ParentAction
{
 public ActionForward log(ActionMapping mapping, ActionForm form, 
HttpServletRequest request, HttpServletResponse response) throws Exception, 
IOException, ServletException {
  System.out.println(INIT_PARAM);  //gives NullPointerException

}

}
I would like to know whether above logic is valid if no is there any other 
workaround?

Regards,
Shakti
_
Winterize your home with tips from MSN House & Home. 
http://special.msn.com/home/warmhome.armx

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


Re: Help URL Rewriting

2003-12-11 Thread Ted Husted
The container can't be sure that any given client supports cookies, so 
it will always use URL rewriting on the first request.

-Ted.

michel Van Asten wrote:
Hi,

I have a strut application running with ServletExec 4.1 (patch 20...)
I want to manage my session with cookies... not url rewrinting
need to disable url Rewriting (to complicate to explain why here...)
1) I Enable cookie in my explorer
2) E disable url rewrinting with ServletExec admin
...

But I still have this code in my start page ??

 <
BR>
How can I control that the cookie is generated ???

Regards,

Michel Van Asten

-
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: HELP: about to get datasource of struts and pass to logic bea ns...

2003-12-08 Thread Vic Cekvenich
Ah a small comment... The Struts DataSource should not be used, I agree;
 the J2EE container DataSource should be used; but it will not be 
removed for a while AFIAK.

(Deprecated just means it might be removed in some futre version. Just 
like hopefully bean, logic and html:link get deprecated in 2.0 in favor 
of JSTL. It's just a nudge from developers (of which I am not one) for 
you to start considering the better alternatives. I even think Java 
should deprecate Connection , ResultSet and java.util.Date  in favor of 
DataSource, RowSet and Calendar)
Poolman is very, very nice... I used it before 2001; when I switched to 
RowSet (before I started using a SQL based DAO). DAO is best thing to do 
now, and all the DB issues would disapper.

.V

Edgar P Dollin wrote:
Don't spend the time to get DataSource working.  It is deprecated and will
be removed from struts in 1.2.  I use Poolman at sourceforge (I highly
reccomend it for non-j2ee projects).  Most others use the DataSource
supplied with the container.
Edgar

-Original Message-
From: Caroline Jen [mailto:[EMAIL PROTECTED]
Sent: Monday, December 08, 2003 4:29 PM
To: Struts Users Mailing List
Subject: Re: HELP: about to get datasource of struts and pass to logic
beans...
There are lots of classes involved.  I will give you
an example:
1. my LogonAction calls EditorService.java (business
delegate)
2. EditorService.java calls MySQLEditorDAO.java (data
access object implements EditorDAO.java, which is a
data access interface)
3. the MySQLEditorDAO.java returns EditorBean.java (a
Java bean with three properties)
Here is my LogonAction.java:

package org.apache.artimus.logon;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionServlet;
import org.apache.artimus.lang.Tokens;

public final class LogonAction extends Action {

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

// Obtain username and password from web tier
String username = ((LogonForm)
form).getUsername();
String password = ((LogonForm)
form).getPassword();

EditorService service = new EditorService();
EditorBean editor = service.findEditorData(
username );

HttpSession session = request.getSession();
session.setAttribute( "editor", editor );
// Log this event, if appropriate

if (servlet.getDebug() >= Tokens.DEBUG) {
StringBuffer message =
new StringBuffer("LogonAction: User
'");
message.append(username);
message.append("' logged on in session ");
message.append(session.getId());
servlet.log(message.toString());
}
// Return success
return (mapping.findForward(Tokens.VALID));
}

} // End LogonAction

Here is the EditorService.java:

package org.apache.artimus.logon;

import org.apache.artimus.logon.dao.*;

public class EditorService 
{
   EditorDAO ed = new MySQLEditorDAO();
   public EditorBean findEditorData( String username )
   {
  return ed.findEditor( username );
   }
}

Here is the EditorDAO.java:

package org.apache.artimus.logon.dao;

import org.apache.artimus.logon.EditorBean;
import
org.apache.artimus.logon.exceptions.EditorDAOSysException;
public interface EditorDAO.java
{
public EditorBean findEditor( String username )
throws EditorDAOSysException;
}
Here is the MySQLEditorDAO.java:

package org.apache.artimus.logon.dao;

import java.io.IOException;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
import java.sql.SQLException;
import org.apache.artimus.logon.EditorBean;
import
org.apache.artimus.logon.exceptions.EditorDAOSysException;
import org.apache.artimus.ConnectionPool.DBConnection;
public class MySQLEditorDAO implements EditorDAO
{
   // Here the return type is EditorBean
   public EditorBean findEditor( String username ) 
   throws EditorDAOSysException 
   {
  Connection conn = null;
  Statement stmt = null;
  ResultSet rs = null;

  try 
  {
 conn = DBConnection.getDBConnection();
 stmt = conn.createStatement();
 String query = "SELECT user_role,
journal_category FROM members WHERE user_name = '" +
username + "'";   
 rs = stmt.executeQuery( query );
 if (rs.next()) 
 {
   

RE: HELP: about to get datasource of struts and pass to logic bea ns...

2003-12-08 Thread Edgar P Dollin
Don't spend the time to get DataSource working.  It is deprecated and will
be removed from struts in 1.2.  I use Poolman at sourceforge (I highly
reccomend it for non-j2ee projects).  Most others use the DataSource
supplied with the container.

Edgar

-Original Message-
From: Caroline Jen [mailto:[EMAIL PROTECTED]
Sent: Monday, December 08, 2003 4:29 PM
To: Struts Users Mailing List
Subject: Re: HELP: about to get datasource of struts and pass to logic
beans...


There are lots of classes involved.  I will give you
an example:

1. my LogonAction calls EditorService.java (business
delegate)
2. EditorService.java calls MySQLEditorDAO.java (data
access object implements EditorDAO.java, which is a
data access interface)
3. the MySQLEditorDAO.java returns EditorBean.java (a
Java bean with three properties)

Here is my LogonAction.java:

package org.apache.artimus.logon;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionServlet;

import org.apache.artimus.lang.Tokens;

public final class LogonAction extends Action {

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

// Obtain username and password from web tier
String username = ((LogonForm)
form).getUsername();
String password = ((LogonForm)
form).getPassword();

EditorService service = new EditorService();
EditorBean editor = service.findEditorData(
username );

HttpSession session = request.getSession();
session.setAttribute( "editor", editor );

// Log this event, if appropriate

if (servlet.getDebug() >= Tokens.DEBUG) {
StringBuffer message =
new StringBuffer("LogonAction: User
'");
message.append(username);
message.append("' logged on in session ");
message.append(session.getId());
servlet.log(message.toString());
}

// Return success
return (mapping.findForward(Tokens.VALID));

}

} // End LogonAction

Here is the EditorService.java:

package org.apache.artimus.logon;

import org.apache.artimus.logon.dao.*;

public class EditorService 
{
   EditorDAO ed = new MySQLEditorDAO();
   public EditorBean findEditorData( String username )
   {
  return ed.findEditor( username );
   }
}

Here is the EditorDAO.java:

package org.apache.artimus.logon.dao;

import org.apache.artimus.logon.EditorBean;
import
org.apache.artimus.logon.exceptions.EditorDAOSysException;

public interface EditorDAO.java
{
public EditorBean findEditor( String username )
throws EditorDAOSysException;
}

Here is the MySQLEditorDAO.java:

package org.apache.artimus.logon.dao;

import java.io.IOException;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
import java.sql.SQLException;

import org.apache.artimus.logon.EditorBean;
import
org.apache.artimus.logon.exceptions.EditorDAOSysException;
import org.apache.artimus.ConnectionPool.DBConnection;

public class MySQLEditorDAO implements EditorDAO
{
   // Here the return type is EditorBean
   public EditorBean findEditor( String username ) 
   throws EditorDAOSysException 
   {
  Connection conn = null;
  Statement stmt = null;
  ResultSet rs = null;

  try 
  {
 conn = DBConnection.getDBConnection();
 stmt = conn.createStatement();
 String query = "SELECT user_role,
journal_category FROM members WHERE user_name = '" +
username + "'";   
 rs = stmt.executeQuery( query );
 if (rs.next()) 
 {
return new EditorBean( username,
rs.getString( "user_role" ), rs.getString(
"journal_category" ) );
 }
 else
 {
System.out.println( "invalid user name" );
return null;
 }
  } 
  catch (SQLException se)
  {
 throw new
EditorDAOSysException("SQLException: " +
se.getMessage());
  }
  finally
  {
 if ( conn != null )
 {
try
{
   rs.close();
   rs = null;
   stmt.close();
   stmt = null;
   conn.close();
}
catch( SQLException sqlEx )
{
   System.out.println( "Pro

Re: HELP: about to get datasource of struts and pass to logic beans...

2003-12-08 Thread Caroline Jen
There are lots of classes involved.  I will give you
an example:

1. my LogonAction calls EditorService.java (business
delegate)
2. EditorService.java calls MySQLEditorDAO.java (data
access object implements EditorDAO.java, which is a
data access interface)
3. the MySQLEditorDAO.java returns EditorBean.java (a
Java bean with three properties)

Here is my LogonAction.java:

package org.apache.artimus.logon;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionServlet;

import org.apache.artimus.lang.Tokens;

public final class LogonAction extends Action {

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

// Obtain username and password from web tier
String username = ((LogonForm)
form).getUsername();
String password = ((LogonForm)
form).getPassword();

EditorService service = new EditorService();
EditorBean editor = service.findEditorData(
username );

HttpSession session = request.getSession();
session.setAttribute( "editor", editor );

// Log this event, if appropriate

if (servlet.getDebug() >= Tokens.DEBUG) {
StringBuffer message =
new StringBuffer("LogonAction: User
'");
message.append(username);
message.append("' logged on in session ");
message.append(session.getId());
servlet.log(message.toString());
}

// Return success
return (mapping.findForward(Tokens.VALID));

}

} // End LogonAction

Here is the EditorService.java:

package org.apache.artimus.logon;

import org.apache.artimus.logon.dao.*;

public class EditorService 
{
   EditorDAO ed = new MySQLEditorDAO();
   public EditorBean findEditorData( String username )
   {
  return ed.findEditor( username );
   }
}

Here is the EditorDAO.java:

package org.apache.artimus.logon.dao;

import org.apache.artimus.logon.EditorBean;
import
org.apache.artimus.logon.exceptions.EditorDAOSysException;

public interface EditorDAO.java
{
public EditorBean findEditor( String username )
throws EditorDAOSysException;
}

Here is the MySQLEditorDAO.java:

package org.apache.artimus.logon.dao;

import java.io.IOException;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
import java.sql.SQLException;

import org.apache.artimus.logon.EditorBean;
import
org.apache.artimus.logon.exceptions.EditorDAOSysException;
import org.apache.artimus.ConnectionPool.DBConnection;

public class MySQLEditorDAO implements EditorDAO
{
   // Here the return type is EditorBean
   public EditorBean findEditor( String username ) 
   throws EditorDAOSysException 
   {
  Connection conn = null;
  Statement stmt = null;
  ResultSet rs = null;

  try 
  {
 conn = DBConnection.getDBConnection();
 stmt = conn.createStatement();
 String query = "SELECT user_role,
journal_category FROM members WHERE user_name = '" +
username + "'";   
 rs = stmt.executeQuery( query );
 if (rs.next()) 
 {
return new EditorBean( username,
rs.getString( "user_role" ), rs.getString(
"journal_category" ) );
 }
 else
 {
System.out.println( "invalid user name" );
return null;
 }
  } 
  catch (SQLException se)
  {
 throw new
EditorDAOSysException("SQLException: " +
se.getMessage());
  }
  finally
  {
 if ( conn != null )
 {
try
{
   rs.close();
   rs = null;
   stmt.close();
   stmt = null;
   conn.close();
}
catch( SQLException sqlEx )
{
   System.out.println( "Problem occurs
while closing " + sqlEx );
}
conn = null;
 }   
  }
   }
}

Here is the EditorBean.java:

package org.apache.artimus.logon;

import org.apache.artimus.logon.dao.*;

public class EditorBean {

   private String username;
   private String userrole;
   private String keyValue;

   static EditorDAO ed = new MySQLEditorDAO();

   public EditorBean() {}
   public EditorBean( String username, String
userrole, String keyValue )
   {
  setUsername( username );
  setUserrole( userrole );
  setKeyValue( keyValue );
   }
   public String getUsername

Re: HELP: about to get datasource of struts and pass to logic beans...

2003-12-06 Thread Vic Cekvenich
Take a look at a very good db example app that uses Struts on iBatis.com
caled PetStore 3.

.V

Ricky wrote:
> hi, there, 
> 
> with my project i had several queries about get datasource in struts. i know how 
> to get datasource in struts, just as in myAction, use getDataSource method and 
> return DataSource object, and go on to get connection  
> 
> i also know the logic beans between the Controller and Module, so i create a 
> logic bean ,i don't know how to get datasourc of pass the datasource, in some 
> tutorial , i got a way to solve this, create a method getDAO(HttpServletRequest 
> request) and pass the request to the method to get DataSource, i was lost here, i 
> dont' know what should i return in getDAO, should i return a DataSource object or 
> others and in my logic bean i can use the datasource and also get connection , 
> statement and resultset object , there i have to close it after i finish my process 
> what do you think of this i did ? in general, when i got a DataSource, i will 
> got a connection from datasource and a PrepareStatement and also a ResultSet , when 
> i finished my process, i can close all object i opened before in final method of try 
> ...catch...experession.. now what should i do to return a proper object in getDAO 
> method and in logic beans i can use the object to process logic business...
> 
> i appologized for this ... i hope you can give me some suggestion or flow.. 
> thanx!
> 
> now here is my flow of struts framework to pass the datasource to the logic beans... 
>  i hope you can reword if you have some good idea...of correct my mistake... :)
> 
> myAction :
> 
> myAction extends Action() {
>   public ActionForward execute(ActionMapping mapping,
>ActionForm form,
>HttpServletRequest request,
>HttpServletResponse response) {
> LogicBean bean = new LogicBean();
> Object objcet = bean.doMethod(getDAO(request), other param)
>   }
>   
>   public DataSource getDAO(HttpServletRequest request) {
> DataSource ds = null;
> ds = getDataSource(request);
> return ds;
>   }
> }
> 
> and in my logic bean :
> 
> class LogicBean {
>   public Objct doMethod(DataSource ds, other param) {
> try {
>   Connection conn = ds.getConnection();
>   PrepareStatment stmt = conn.prepareStatment("SELECT ...");
>   stmt.setInt(1,);
>   ResultSet rs = stmt.executeQuery();
>   
>   return Object.;
> } catch (SQLException ex) {
>   ex.printStactTrace();
> } final {
>   try {
> rs.close();
> stmt.close();
> conn.close()
>   } catch (Exception ex) {
> ex.printStactTrace();
>   }
> }
> return null;
>   }
> }
> 
> should i pass the DataSource to my logic beans? otherwise what object should i 
> pass



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



Re: Help needed.....nested iterate problem

2003-11-16 Thread sumeet sharma
Hi,
 Make use of nested:iterate .. its pretty simple to use and it is ment to 
iterate inside an iterate
But do make a parent child relationship for this nested iterate to work

Rgds,
Sumeet:)

On Mon, 17 Nov 2003 Hari_s wrote :
>Hi everyone..
>I have problem with iterate within iterate..
>I have iterate table that contain iterate data 
>and this is my code ...
>
>
>value="${ide.tanggal}">
>
>
> 
>
>
> 
>
>
>but that code produce error like this
>javax.servlet.jsp.JspException: No getter method for property data2 of bean ide
>   java.lang.Object 
> org.apache.struts.util.RequestUtils.lookup(javax.servlet.jsp.PageContext, 
> java.lang.String, java.lang.String, java.lang.String)
>   RequestUtils.java:907
>   int org.apache.struts.taglib.logic.IterateTag.doStartTag()
>   IterateTag.java:277
>   void _Frame1._jspService(javax.servlet.http.HttpServletRequest, 
> javax.servlet.http.HttpServletResponse)
>   [/Frame1.jsp]
>   Frame1.jsp:15
>   void oracle.jsp.runtime.HttpJsp.service(javax.servlet.ServletRequest, 
> javax.servlet.ServletResponse)
>   HttpJsp.java:139
>   [SRC:/Frame1.jsp:16]
>   void 
> oracle.jsp.runtimev2.JspPageTable.service(javax.servlet.http.HttpServletRequest, 
> javax.servlet.http.HttpServletResponse, java.lang.String)
>   JspPageTable.java:317
>   void 
> oracle.jsp.runtimev2.JspServlet.internalService(javax.servlet.http.HttpServletRequest,
>  javax.servlet.http.HttpServletResponse)
>   JspServlet.java:465
>   void 
> oracle.jsp.runtimev2.JspServlet.service(javax.servlet.http.HttpServletRequest, 
> javax.servlet.http.HttpServletResponse)
>   JspServlet.java:379
>   void javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest, 
> javax.servlet.ServletResponse)
>   HttpServlet.java:853
>   void com.evermind[Oracle9iAS (9.0.3.0.0) Containers for 
> J2EE].server.http.ServletRequestDispatcher.invoke(javax.servlet.ServletRequest, 
> javax.servlet.ServletResponse)
>   ServletRequestDispatcher.java:721
>   void com.evermind[Oracle9iAS (9.0.3.0.0) Containers for 
> J2EE].server.http.ServletRequestDispatcher.forwardInternal(javax.servlet.ServletRequest,
>  javax.servlet.http.HttpServletResponse)
>   ServletRequestDispatcher.java:306
>   void com.evermind[Oracle9iAS (9.0.3.0.0) Containers for 
> J2EE].server.http.ServletRequestDispatcher.forward(javax.servlet.ServletRequest, 
> javax.servlet.ServletResponse)
>   ServletRequestDispatcher.java:209
>   void org.apache.struts.action.RequestProcessor.doForward(java.lang.String, 
> javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
>   RequestProcessor.java:1069
>   void 
> org.apache.struts.action.RequestProcessor.processForwardConfig(javax.servlet.http.HttpServletRequest,
>  javax.servlet.http.HttpServletResponse, org.apache.struts.config.ForwardConfig)
>   RequestProcessor.java:455
>   void 
> org.apache.struts.action.RequestProcessor.process(javax.servlet.http.HttpServletRequest,
>  javax.servlet.http.HttpServletResponse)
>   RequestProcessor.java:279
>   void 
> org.apache.struts.action.ActionServlet.process(javax.servlet.http.HttpServletRequest,
>  javax.servlet.http.HttpServletResponse)
>   ActionServlet.java:1480
>   void 
> org.apache.struts.action.ActionServlet.doGet(javax.servlet.http.HttpServletRequest, 
> javax.servlet.http.HttpServletResponse)
>   ActionServlet.java:506
>   void 
> javax.servlet.http.HttpServlet.service(javax.servlet.http.HttpServletRequest, 
> javax.servlet.http.HttpServletResponse)
>   HttpServlet.java:740
>   void javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest, 
> javax.servlet.ServletResponse)
>   HttpServlet.java:853
>   void com.evermind[Oracle9iAS (9.0.3.0.0) Containers for 
> J2EE].server.http.ServletRequestDispatcher.invoke(javax.servlet.ServletRequest, 
> javax.servlet.ServletResponse)
>   ServletRequestDispatcher.java:721
>   void com.evermind[Oracle9iAS (9.0.3.0.0) Containers for 
> J2EE].server.http.ServletRequestDispatcher.forwardInternal(javax.servlet.ServletRequest,
>  javax.servlet.http.HttpServletResponse)
>   ServletRequestDispatcher.java:306
>   boolean com.evermind[Oracle9iAS (9.0.3.0.0) Containers for 
> J2EE].server.http.HttpRequestHandler.processRequest(com.evermind[Oracle9iAS 
> (9.0.3.0.0) Containers for J2EE].server.ApplicationServerThread, 
> com.evermind[Oracle9iAS (9.0.3.0.0) Containers for 
> J2EE].server.http.EvermindHttpServletRequest, com.evermind[Oracle9iAS (9.0.3.0.0) 
> Containers for J2EE].server.http.EvermindHttpServletResponse, java.io.InputStream, 
> java.io.OutputStream, boolean)
>   HttpRequestHandler.java:767
>   void com.evermind[Oracle9iAS (9.0.

Re: Help - Looping with iterate without collection is possible?

2003-11-05 Thread Henrique VIECILI
Thank you a lot!!

It works perfectly! 
(or in Portuguese: "Funcionou Redondo!")

Henrique

- Original Message - 
From: "David Graham" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Wednesday, November 05, 2003 3:06 PM
Subject: Re: Help - Looping with iterate without collection is possible?


> 
> --- Henrique VIECILI <[EMAIL PROTECTED]> wrote:
> > Hi,
> > 
> > can i make a loop using logic:iterate (or any other tag) without
> > defining a
> > collection to iterate? I just wanna have a 'for' behavior...
> 
> The JSTL has a  tag that does this.
> 
> http://java.sun.com/products/jsp/jstl/
> 
> David
> 
> > 
> > thanx
> > 
> > 
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> 
> 
> __
> Do you Yahoo!?
> Protect your identity with Yahoo! Mail AddressGuard
> http://antispam.yahoo.com/whatsnewfree
> 
> -
> 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: Help - Looping with iterate without collection is possible?

2003-11-05 Thread David Graham

--- Henrique VIECILI <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> can i make a loop using logic:iterate (or any other tag) without
> defining a
> collection to iterate? I just wanna have a 'for' behavior...

The JSTL has a  tag that does this.

http://java.sun.com/products/jsp/jstl/

David

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


__
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree

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



Re: Help Req on Iterate Tag using HashMap [PROBLEM SOLVED]

2003-11-05 Thread Shakti
Hi ,
  Thanks buddy, it was the perfect solution that i was looking for ...
:-)
chao ...
Shakti

- Original Message -
From: "Sunny" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Wednesday, November 05, 2003 3:12 PM
Subject: Re: Help Req on Iterate Tag using HashMap


> 
> 
> 
> 
>  
> 
> 
>  
> 
> 
>  
> 
> 
>  
> 
> 
> 
>
> You need to have respective Getter Methods in the EMPDetails Bean.
>
>
> On Wednesday 05 November 2003 02:57 pm, you wrote:
> > Thanks for your reply boss,
> >  but still its doesn't solves my problem .. I know this method of
iterating
> > thru an Array list taking out a bean from that .. but I want to USE A
HASH
> > MAP ...
> > anyone who can help me out of this 
> > waiting 4 ur reply guyz .
> > chao ...
> > shakti
> >
> > ----- Original Message -
> > From: "Sashi Ravipati" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Tuesday, November 04, 2003 6:46 PM
> > Subject: Re: Help Req on Iterate Tag using HashMap
> >
> > > Hi
> > >
> > > This is how we iterate in a jsp page
> > >
> > > 
> > >  > > property="assocSBList" indexId="i" >
> > > 
> > >  > > size="10"  />
> > >   > > maxlength="10"size="10" />
> > > 
> > > 
> > > 
> > >
> > > where addProviderForm is the Struts Form bean and assocSBList is the
> > > ArrayList defined in the form bean.
> > >
> > > Hope this helps.
> > >
> > > Thanks
> > >
> > > >>> [EMAIL PROTECTED] 11/4/2003 6:43:27 AM >>>
> > >
> > > Hi All,
> > > I am keeping some table data in a HashMap .
> > > My Table is in this form :
> > > UID #EMP Details
> > >-Date of joining
> > >-Date of birth
> > >-Misc Detail
> > >
> > > Now i am creating an EMPDetails bean and storing the bean in a hash
map
> > > with UID # as the key.
> > >
> > > Can anyone plz tell me how to show the data in a tabular form in jsp
> > > using iterate tag . I am unable to make out as how to
> > > iterate the EMPDetails bean which i am getting as value .
> > >
> > > Thanks & Regards,
> > > Shakti
> > >
> > > -
> > > 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: Help Req on Iterate Tag using HashMap

2003-11-05 Thread Sunny




 


 


 


 




You need to have respective Getter Methods in the EMPDetails Bean.


On Wednesday 05 November 2003 02:57 pm, you wrote:
> Thanks for your reply boss,
>  but still its doesn't solves my problem .. I know this method of iterating
> thru an Array list taking out a bean from that .. but I want to USE A HASH
> MAP ...
> anyone who can help me out of this 
> waiting 4 ur reply guyz .
> chao ...
> shakti
>
> - Original Message -
> From: "Sashi Ravipati" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, November 04, 2003 6:46 PM
> Subject: Re: Help Req on Iterate Tag using HashMap
>
> > Hi
> >
> > This is how we iterate in a jsp page
> >
> > 
> >  > property="assocSBList" indexId="i" >
> > 
> >  > size="10"  />
> >   > maxlength="10"size="10" />
> > 
> > 
> > 
> >
> > where addProviderForm is the Struts Form bean and assocSBList is the
> > ArrayList defined in the form bean.
> >
> > Hope this helps.
> >
> > Thanks
> >
> > >>> [EMAIL PROTECTED] 11/4/2003 6:43:27 AM >>>
> >
> > Hi All,
> > I am keeping some table data in a HashMap .
> > My Table is in this form :
> > UID #EMP Details
> >-Date of joining
> >-Date of birth
> >-Misc Detail
> >
> > Now i am creating an EMPDetails bean and storing the bean in a hash map
> > with UID # as the key.
> >
> > Can anyone plz tell me how to show the data in a tabular form in jsp
> > using iterate tag . I am unable to make out as how to
> > iterate the EMPDetails bean which i am getting as value .
> >
> > Thanks & Regards,
> > Shakti
> >
> > -
> > 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: Help Req on Iterate Tag using HashMap

2003-11-05 Thread Ashish Sinha
Hi,

The following piece of code works fine with me. I use it to display data in
a drop down / select box.

  
  
  
  
  
  

Regards,
Ashish.
[Povedu do bezkonechnostiu.]

- Original Message -
From: "Shakti" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Wednesday, November 05, 2003 9:27 AM
Subject: Re: Help Req on Iterate Tag using HashMap


> Thanks for your reply boss,
>  but still its doesn't solves my problem .. I know this method of
iterating
> thru an Array list taking out a bean from that .. but I want to USE A HASH
> MAP ...
> anyone who can help me out of this 
> waiting 4 ur reply guyz .
> chao ...
> shakti
>
> - Original Message -
> From: "Sashi Ravipati" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, November 04, 2003 6:46 PM
> Subject: Re: Help Req on Iterate Tag using HashMap
>
>
> > Hi
> >
> > This is how we iterate in a jsp page
> >
> > 
> >  > property="assocSBList" indexId="i" >
> > 
> >  > size="10"  />
> >   > maxlength="10"size="10" />
> > 
> > 
> > 
> >
> > where addProviderForm is the Struts Form bean and assocSBList is the
> > ArrayList defined in the form bean.
> >
> > Hope this helps.
> >
> > Thanks
> >
> > >>> [EMAIL PROTECTED] 11/4/2003 6:43:27 AM >>>
> > Hi All,
> > I am keeping some table data in a HashMap .
> > My Table is in this form :
> > UID #EMP Details
> >-Date of joining
> >-Date of birth
> >-Misc Detail
> >
> > Now i am creating an EMPDetails bean and storing the bean in a hash map
> > with UID # as the key.
> >
> > Can anyone plz tell me how to show the data in a tabular form in jsp
> > using iterate tag . I am unable to make out as how to
> > iterate the EMPDetails bean which i am getting as value .
> >
> > Thanks & Regards,
> > Shakti
> >
> > -
> > 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: Help Req on Iterate Tag using HashMap

2003-11-05 Thread Nicolas De Loof
Sory if this has allready been proposed, I didn't read this thread from begining. 

Did you try something like this :


uid = 
Date of joining = 


Nico.


> Thanks for your reply boss,
>  but still its doesn't solves my problem .. I know this method of iterating
> thru an Array list taking out a bean from that .. but I want to USE A HASH
> MAP ...
> anyone who can help me out of this 
> waiting 4 ur reply guyz .
> chao ...
> shakti
> 
> - Original Message -
> From: "Sashi Ravipati" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, November 04, 2003 6:46 PM
> Subject: Re: Help Req on Iterate Tag using HashMap
> 
> 
> > Hi
> >
> > This is how we iterate in a jsp page
> >
> > 
> >  > property="assocSBList" indexId="i" >
> > 
> >  > size="10"  />
> >   > maxlength="10"size="10" />
> > 
> > 
> > 
> >
> > where addProviderForm is the Struts Form bean and assocSBList is the
> > ArrayList defined in the form bean.
> >
> > Hope this helps.
> >
> > Thanks
> >
> > >>> [EMAIL PROTECTED] 11/4/2003 6:43:27 AM >>>
> > Hi All,
> > I am keeping some table data in a HashMap .
> > My Table is in this form :
> > UID #EMP Details
> >-Date of joining
> >-Date of birth
> >-Misc Detail
> >
> > Now i am creating an EMPDetails bean and storing the bean in a hash map
> > with UID # as the key.
> >
> > Can anyone plz tell me how to show the data in a tabular form in jsp
> > using iterate tag . I am unable to make out as how to
> > iterate the EMPDetails bean which i am getting as value .
> >
> > Thanks & Regards,
> > Shakti
> >
> > -
> > 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: Help Req on Iterate Tag using HashMap

2003-11-05 Thread Shakti
Thanks for your reply boss,
 but still its doesn't solves my problem .. I know this method of iterating
thru an Array list taking out a bean from that .. but I want to USE A HASH
MAP ...
anyone who can help me out of this 
waiting 4 ur reply guyz .
chao ...
shakti

- Original Message -
From: "Sashi Ravipati" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, November 04, 2003 6:46 PM
Subject: Re: Help Req on Iterate Tag using HashMap


> Hi
>
> This is how we iterate in a jsp page
>
> 
>  property="assocSBList" indexId="i" >
> 
>  size="10"  />
>   maxlength="10"size="10" />
> 
> 
> 
>
> where addProviderForm is the Struts Form bean and assocSBList is the
> ArrayList defined in the form bean.
>
> Hope this helps.
>
> Thanks
>
> >>> [EMAIL PROTECTED] 11/4/2003 6:43:27 AM >>>
> Hi All,
> I am keeping some table data in a HashMap .
> My Table is in this form :
> UID #EMP Details
>-Date of joining
>-Date of birth
>-Misc Detail
>
> Now i am creating an EMPDetails bean and storing the bean in a hash map
> with UID # as the key.
>
> Can anyone plz tell me how to show the data in a tabular form in jsp
> using iterate tag . I am unable to make out as how to
> iterate the EMPDetails bean which i am getting as value .
>
> Thanks & Regards,
> Shakti
>
> -
> 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: Help Req on Iterate Tag using HashMap

2003-11-04 Thread Sashi Ravipati
Hi

This is how we iterate in a jsp page





 




where addProviderForm is the Struts Form bean and assocSBList is the
ArrayList defined in the form bean.

Hope this helps.

Thanks

>>> [EMAIL PROTECTED] 11/4/2003 6:43:27 AM >>>
Hi All,
I am keeping some table data in a HashMap .
My Table is in this form :
UID #EMP Details
   -Date of joining
   -Date of birth
   -Misc Detail

Now i am creating an EMPDetails bean and storing the bean in a hash map
with UID # as the key.

Can anyone plz tell me how to show the data in a tabular form in jsp
using iterate tag . I am unable to make out as how to 
iterate the EMPDetails bean which i am getting as value .

Thanks & Regards,
Shakti

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



RE: Help with framesets

2003-11-04 Thread Jose Ramon Diaz

 I think the frames&Struts question is a bit more complicated. I write here
what I told in another message several days ago. (nobody tells me what they
think... so I continue posting it... :) if you use frames, please tell me
what you think)
 Imagine if one action may load the same frame set but you have to  load
hundred of different pages inside each frame.

> We use Frames in our application. We have had this problem a we use
different approach.
 We suppose the form data is ONLY needed for the action, so the action
executes and change the model as needed. The action decides which is the
next page, and if it can have frames it sets a variable "next" in session,
which indicates what the frames that must be loades in this way:

 Every frame in frameset is redirected to an special action frames.do with
two parameters: the place where the frame is loaded and the "next" variable.
For example:


">
">


  And we have implemented the frames.do action to know which JSP must be
loaded, with parameters position and next. In fact, the page that must be
loaded is written in struts-config.xml in this way:

   
  
  c



So the frames.do makes a forward to the String created with "position+next"
(the two parameter of frames.do) and we can establish the JSP in the xml
file...

   Regards

 Jose R. Diaz


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



Re: Help with framesets

2003-11-03 Thread Jim Theodoridis
Hello!

Is it possible to work with framesets with tiles?

I want to have one action and the data from that action displays in
different ways from 2 or more frame sets

I ve tried to work with frameLayout of tiles paradigms but
only 1 frame works well. 

- Original Message - 
From: "javen fang" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Monday, November 03, 2003 6:44 PM
Subject: RE: Help with framesets


> left have a query:
> 
>  target="rigth"/>
> 
> then view the result in the rigth content frame.
> 
> javen
> 
> 
> --- Vijay Kandy <[EMAIL PROTECTED]> wrote:
> > Javen,
> > 
> > Thank you for your response. So you are saying
> >  tag in
> > struts-config.xml has a "target" attribute or does
> > it go in the JSP? I
> > looked in the struts-config.dtd but couldnt find
> > "target". 
> > 
> > If its not too much to ask, could you explain with a
> > sample action?
> > 
> > --Vijay
> > 
> > -Original Message-
> > From: javen fang [mailto:[EMAIL PROTECTED]
> > Sent: Monday, November 03, 2003 11:16 AM
> > To: Struts Users Mailing List
> > Subject: Re: Help with framesets
> > 
> > 
> > your frames have names: header / left / right
> > 
> > so when you action mapping, you may use target tag.
> > 
> > Example, if left , an action is a query data,and
> > view
> > it in right,just:
> > 
> > target = right.   
> > 
> > form and href both have target attribute.
> > 
> > Good luck.
> > javen
> > 
> > 
> > --- Vijay Kandy <[EMAIL PROTECTED]> wrote:
> > > Hello,
> > > 
> > > Could some one point me to a frameset based web
> > > application or war file? I
> > > am having trouble understanding the flow in a
> > > frameset situation. I am
> > > trying to redesign an existing non struts based
> > > webapp. The current layout
> > > is that there is frameset within frameset
> > containing
> > > "menu" and "content
> > > area" as frames, like so:
> > > 
> > >  > framespacing="0"
> > > topmargin="0"
> > > leftmargin="0" marginheight="0" marginwidth="0">
> > > > > scrolling=no noresize
> > > action="header.do"/>
> > > > > frameborder=0>
> > >> > action="menu.do"/>
> > >> frameName="right"
> > > action="content.do"/>
> > >
> > > 
> > > 
> > > I am not sure how to forward actions now. I will
> > be
> > > grateful for any help.
> > > 
> > > -Vijay 
> > > 
> > >
> >
> -
> > > 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]
> > 
> 
> 
> __
> 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: Help with framesets

2003-11-03 Thread javen fang
left have a query:



then view the result in the rigth content frame.

javen


--- Vijay Kandy <[EMAIL PROTECTED]> wrote:
> Javen,
> 
> Thank you for your response. So you are saying
>  tag in
> struts-config.xml has a "target" attribute or does
> it go in the JSP? I
> looked in the struts-config.dtd but couldnt find
> "target". 
> 
> If its not too much to ask, could you explain with a
> sample action?
> 
> --Vijay
> 
> -Original Message-
> From: javen fang [mailto:[EMAIL PROTECTED]
> Sent: Monday, November 03, 2003 11:16 AM
> To: Struts Users Mailing List
> Subject: Re: Help with framesets
> 
> 
> your frames have names: header / left / right
> 
> so when you action mapping, you may use target tag.
> 
> Example, if left , an action is a query data,and
> view
> it in right,just:
> 
> target = right.   
> 
> form and href both have target attribute.
> 
> Good luck.
> javen
> 
> 
> --- Vijay Kandy <[EMAIL PROTECTED]> wrote:
> > Hello,
> > 
> > Could some one point me to a frameset based web
> > application or war file? I
> > am having trouble understanding the flow in a
> > frameset situation. I am
> > trying to redesign an existing non struts based
> > webapp. The current layout
> > is that there is frameset within frameset
> containing
> > "menu" and "content
> > area" as frames, like so:
> > 
> >  framespacing="0"
> > topmargin="0"
> > leftmargin="0" marginheight="0" marginwidth="0">
> > > scrolling=no noresize
> > action="header.do"/>
> > > frameborder=0>
> >> action="menu.do"/>
> >frameName="right"
> > action="content.do"/>
> >
> > 
> > 
> > I am not sure how to forward actions now. I will
> be
> > grateful for any help.
> > 
> > -Vijay 
> > 
> >
>
-
> > 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]
> 


__
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: Help with framesets

2003-11-03 Thread Vijay Kandy
Thank you! I understand now.

-Vijay

-Original Message-
From: Rajat Pandit [mailto:[EMAIL PROTECTED]
Sent: Monday, November 03, 2003 11:08 AM
To: Struts Users Mailing List
Subject: Re: Help with framesets


http://localhost:8080/struts-documentation/userGuide/struts-html.html#link
in the 

target - The window target in which the resource requested by this 
hyperlink will be displayed, for example in a framed presentation.
(RT EXPR)



in your case target="left|right|"
Vijay Kandy wrote:

> Hello,
> 
> Could some one point me to a frameset based web application or war file? I
> am having trouble understanding the flow in a frameset situation. I am
> trying to redesign an existing non struts based webapp. The current layout
> is that there is frameset within frameset containing "menu" and "content
> area" as frames, like so:
> 
>  leftmargin="0" marginheight="0" marginwidth="0">
> action="header.do"/>
>
>   
>   
>
> 
> 
> I am not sure how to forward actions now. I will be grateful for any help.
> 
> -Vijay 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

-- 


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]

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



RE: Help with framesets

2003-11-03 Thread Vijay Kandy
Javen,

Thank you for your response. So you are saying  tag in
struts-config.xml has a "target" attribute or does it go in the JSP? I
looked in the struts-config.dtd but couldnt find "target". 

If its not too much to ask, could you explain with a sample action?

--Vijay

-Original Message-
From: javen fang [mailto:[EMAIL PROTECTED]
Sent: Monday, November 03, 2003 11:16 AM
To: Struts Users Mailing List
Subject: Re: Help with framesets


your frames have names: header / left / right

so when you action mapping, you may use target tag.

Example, if left , an action is a query data,and view
it in right,just:

target = right.   

form and href both have target attribute.

Good luck.
javen


--- Vijay Kandy <[EMAIL PROTECTED]> wrote:
> Hello,
> 
> Could some one point me to a frameset based web
> application or war file? I
> am having trouble understanding the flow in a
> frameset situation. I am
> trying to redesign an existing non struts based
> webapp. The current layout
> is that there is frameset within frameset containing
> "menu" and "content
> area" as frames, like so:
> 
>  topmargin="0"
> leftmargin="0" marginheight="0" marginwidth="0">
> scrolling=no noresize
> action="header.do"/>
> frameborder=0>
>action="menu.do"/>
>action="content.do"/>
>
> 
> 
> I am not sure how to forward actions now. I will be
> grateful for any help.
> 
> -Vijay 
> 
>
-
> 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: Help with framesets

2003-11-03 Thread Rajat Pandit
http://localhost:8080/struts-documentation/userGuide/struts-html.html#link
in the 
target - The window target in which the resource requested by this 
hyperlink will be displayed, for example in a framed presentation.
(RT EXPR)



in your case target="left|right|"
Vijay Kandy wrote:
Hello,

Could some one point me to a frameset based web application or war file? I
am having trouble understanding the flow in a frameset situation. I am
trying to redesign an existing non struts based webapp. The current layout
is that there is frameset within frameset containing "menu" and "content
area" as frames, like so:

   
   
  
  
   

I am not sure how to forward actions now. I will be grateful for any help.

-Vijay 

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

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: Help with framesets

2003-11-03 Thread javen fang
your frames have names: header / left / right

so when you action mapping, you may use target tag.

Example, if left , an action is a query data,and view
it in right,just:

target = right.   

form and href both have target attribute.

Good luck.
javen


--- Vijay Kandy <[EMAIL PROTECTED]> wrote:
> Hello,
> 
> Could some one point me to a frameset based web
> application or war file? I
> am having trouble understanding the flow in a
> frameset situation. I am
> trying to redesign an existing non struts based
> webapp. The current layout
> is that there is frameset within frameset containing
> "menu" and "content
> area" as frames, like so:
> 
>  topmargin="0"
> leftmargin="0" marginheight="0" marginwidth="0">
> scrolling=no noresize
> action="header.do"/>
> frameborder=0>
>action="menu.do"/>
>action="content.do"/>
>
> 
> 
> I am not sure how to forward actions now. I will be
> grateful for any help.
> 
> -Vijay 
> 
>
-
> 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: Help please -- How to provide a "Back" button?

2003-10-29 Thread ZYD
thanks buddy!

- Original Message - 
From: "Jimmy Emmanual" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Thursday, October 30, 2003 4:44 AM
Subject: RE: Help please -- How to provide a "Back" button?


> Back
> 
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, October 29, 2003 3:25 PM
> To: Struts Users Mailing List
> Subject: Re: Help please -- How to provide a "Back" button?
> 
> 
> for ur question 2:
> 
> you can use javascript function to call two different action:
> 
> function faddpurpose() {
> document.editform.methodtocall.value = "addpurpose";
> document.editform.forwardpage.value = "totalsuccess";
> document.editform.target="_self";
> document.editform.submit();
> }
> 
> function fcalculatepaypd() {
> document.editform.methodtocall.value = "calculatepaypd";
> document.editform.forwardpage.value = "totalsuccess";
> document.editform.target="_self";
> document.editform.submit();
> }
>  type="aaa.ers.struts.forms.RecordsForm">
> 
> so U can create a dispatch action and call two different action changing 
> value for methodtocall.If you are not using dispatch action then just set 
> your forms action to whatever action U want to go to..
> 
> 
> 
> 
> "ZYD" <[EMAIL PROTECTED]>
> 10/29/2003 01:18 AM
> Please respond to "Struts Users Mailing List"
> 
>  
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> cc: 
> Subject:Help please -- How to provide a "Back" button?
> 
> 
> Dear all,
> 
> Question 1:
> 
> How to provide a Back button on a page?
> 
> Is there a html tag like the one for Cancel button:  ?
> 
> Question 2:
> 
> How to provide two submit buttons on one JSP page,
> when click on the 1st button, the page is submitted to 1st action,
> when click on the 2nd button, it's submitted to 2nd action?
> 
> Any response will be appreciated.
> Thanks.
> 
> bruce
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

Re: Help please -- How to provide a "Back" button?

2003-10-29 Thread ZYD
Hi my friend, you solve my problem, thanks!!

bruce


- Original Message - 
From: "ishmael riles" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Cc: "ZYD" <[EMAIL PROTECTED]>
Sent: Thursday, October 30, 2003 5:11 AM
Subject: Re: Help please -- How to provide a "Back" button?


> 
> Another solution if you don't want to use javascript, is to rely on the
> fact that the name and value atrributes of the submit button that was
> pressed are passed through the http request. The values for the other
> submit buttons aren't sent. So in your action you check for the existance
> of each submit buttons name to figure out which button the user pushed.
> 
> So if you have the following submit buttons in your jsp file
> 
>  SAVE
>  CANCEL
> 
> Then in your action you can do something like this:
> 
>  String saveAction = request.getParameter("save");
>  String cancelAction = request.getParameter("cancel");
> 
>  if (saveAction != null) {
>  doSave();
>  } else if (cancelAction != null) {
>  doCancel();
>  }
> 
> On Wed, 29 Oct 2003 14:24:54 -0600, [EMAIL PROTECTED] said:
> > for ur question 2:
> > 
> > you can use javascript function to call two different action:
> > 
> > function faddpurpose() {
> > document.editform.methodtocall.value = "addpurpose";
> > document.editform.forwardpage.value = "totalsuccess";
> > document.editform.target="_self";
> > document.editform.submit();
> > }
> > 
> > function fcalculatepaypd() {
> > document.editform.methodtocall.value = "calculatepaypd";
> > document.editform.forwardpage.value = "totalsuccess";
> > document.editform.target="_self";
> > document.editform.submit();
> > }
> >  > type="aaa.ers.struts.forms.RecordsForm">
> > 
> > so U can create a dispatch action and call two different action changing 
> > value for methodtocall.If you are not using dispatch action then just set 
> > your forms action to whatever action U want to go to..
> > 
> > 
> > 
> > 
> > "ZYD" <[EMAIL PROTECTED]>
> > 10/29/2003 01:18 AM
> > Please respond to "Struts Users Mailing List"
> > 
> >  
> > To: "Struts Users Mailing List"
> > <[EMAIL PROTECTED]>
> > cc: 
> > Subject:Help please -- How to provide a "Back" button?
> > 
> > 
> > Dear all,
> > 
> > Question 1:
> > 
> > How to provide a Back button on a page?
> > 
> > Is there a html tag like the one for Cancel button:  ?
> > 
> > Question 2:
> > 
> > How to provide two submit buttons on one JSP page,
> > when click on the 1st button, the page is submitted to 1st action,
> > when click on the 2nd button, it's submitted to 2nd action?
> > 
> > Any response will be appreciated.
> > Thanks.
> > 
> > bruce
> > 
>  
>  -o- -o- -o- -o- -o-
>   ishmael.riles  
>   brnr.tech
>   510.543.6109
>  -o- -o- -o- -o- -o-
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

Re: Help please -- How to provide a "Back" button?

2003-10-29 Thread ZYD
Thanks for your fast response, it's of GREAT help, thanks a lot my friend.

bruce

- Original Message - 
From: <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, October 30, 2003 4:24 AM
Subject: Re: Help please -- How to provide a "Back" button?


> for ur question 2:
> 
> you can use javascript function to call two different action:
> 
> function faddpurpose() {
> document.editform.methodtocall.value = "addpurpose";
> document.editform.forwardpage.value = "totalsuccess";
> document.editform.target="_self";
> document.editform.submit();
> }
> 
> function fcalculatepaypd() {
> document.editform.methodtocall.value = "calculatepaypd";
> document.editform.forwardpage.value = "totalsuccess";
> document.editform.target="_self";
> document.editform.submit();
> }
>  type="aaa.ers.struts.forms.RecordsForm">
> 
> so U can create a dispatch action and call two different action changing 
> value for methodtocall.If you are not using dispatch action then just set 
> your forms action to whatever action U want to go to..
> 
> 
> 
> 
> "ZYD" <[EMAIL PROTECTED]>
> 10/29/2003 01:18 AM
> Please respond to "Struts Users Mailing List"
> 
>  
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> cc: 
> Subject:Help please -- How to provide a "Back" button?
> 
> 
> Dear all,
> 
> Question 1:
> 
> How to provide a Back button on a page?
> 
> Is there a html tag like the one for Cancel button:  ?
> 
> Question 2:
> 
> How to provide two submit buttons on one JSP page,
> when click on the 1st button, the page is submitted to 1st action,
> when click on the 2nd button, it's submitted to 2nd action?
> 
> Any response will be appreciated.
> Thanks.
> 
> bruce
> 
> 

Re: Help please -- How to provide a "Back" button?

2003-10-29 Thread ishmael riles

Another solution if you don't want to use javascript, is to rely on the
fact that the name and value atrributes of the submit button that was
pressed are passed through the http request. The values for the other
submit buttons aren't sent. So in your action you check for the existance
of each submit buttons name to figure out which button the user pushed.

So if you have the following submit buttons in your jsp file

 SAVE
 CANCEL

Then in your action you can do something like this:

 String saveAction = request.getParameter("save");
 String cancelAction = request.getParameter("cancel");

 if (saveAction != null) {
 doSave();
 } else if (cancelAction != null) {
 doCancel();
 }

On Wed, 29 Oct 2003 14:24:54 -0600, [EMAIL PROTECTED] said:
> for ur question 2:
> 
> you can use javascript function to call two different action:
> 
> function faddpurpose() {
> document.editform.methodtocall.value = "addpurpose";
> document.editform.forwardpage.value = "totalsuccess";
> document.editform.target="_self";
> document.editform.submit();
> }
> 
> function fcalculatepaypd() {
> document.editform.methodtocall.value = "calculatepaypd";
> document.editform.forwardpage.value = "totalsuccess";
> document.editform.target="_self";
> document.editform.submit();
> }
>  type="aaa.ers.struts.forms.RecordsForm">
> 
> so U can create a dispatch action and call two different action changing 
> value for methodtocall.If you are not using dispatch action then just set 
> your forms action to whatever action U want to go to..
> 
> 
> 
> 
> "ZYD" <[EMAIL PROTECTED]>
> 10/29/2003 01:18 AM
> Please respond to "Struts Users Mailing List"
> 
>  
> To: "Struts Users Mailing List"
> <[EMAIL PROTECTED]>
> cc: 
> Subject:Help please -- How to provide a "Back" button?
> 
> 
> Dear all,
> 
> Question 1:
> 
> How to provide a Back button on a page?
> 
> Is there a html tag like the one for Cancel button:  ?
> 
> Question 2:
> 
> How to provide two submit buttons on one JSP page,
> when click on the 1st button, the page is submitted to 1st action,
> when click on the 2nd button, it's submitted to 2nd action?
> 
> Any response will be appreciated.
> Thanks.
> 
> bruce
> 
 
 -o- -o- -o- -o- -o-
  ishmael.riles  
  brnr.tech
  510.543.6109
 -o- -o- -o- -o- -o-

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



RE: Help please -- How to provide a "Back" button?

2003-10-29 Thread Jimmy Emmanual
Back

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 29, 2003 3:25 PM
To: Struts Users Mailing List
Subject: Re: Help please -- How to provide a "Back" button?


for ur question 2:

you can use javascript function to call two different action:

function faddpurpose() {
document.editform.methodtocall.value = "addpurpose";
document.editform.forwardpage.value = "totalsuccess";
document.editform.target="_self";
document.editform.submit();
}

function fcalculatepaypd() {
document.editform.methodtocall.value = "calculatepaypd";
document.editform.forwardpage.value = "totalsuccess";
document.editform.target="_self";
document.editform.submit();
}


so U can create a dispatch action and call two different action changing 
value for methodtocall.If you are not using dispatch action then just set 
your forms action to whatever action U want to go to..




"ZYD" <[EMAIL PROTECTED]>
10/29/2003 01:18 AM
Please respond to "Struts Users Mailing List"

 
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
cc: 
Subject:Help please -- How to provide a "Back" button?


Dear all,

Question 1:

How to provide a Back button on a page?

Is there a html tag like the one for Cancel button:  ?

Question 2:

How to provide two submit buttons on one JSP page,
when click on the 1st button, the page is submitted to 1st action,
when click on the 2nd button, it's submitted to 2nd action?

Any response will be appreciated.
Thanks.

bruce


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



Re: Help please -- How to provide a "Back" button?

2003-10-29 Thread VKeswani
for ur question 2:

you can use javascript function to call two different action:

function faddpurpose() {
document.editform.methodtocall.value = "addpurpose";
document.editform.forwardpage.value = "totalsuccess";
document.editform.target="_self";
document.editform.submit();
}

function fcalculatepaypd() {
document.editform.methodtocall.value = "calculatepaypd";
document.editform.forwardpage.value = "totalsuccess";
document.editform.target="_self";
document.editform.submit();
}


so U can create a dispatch action and call two different action changing 
value for methodtocall.If you are not using dispatch action then just set 
your forms action to whatever action U want to go to..




"ZYD" <[EMAIL PROTECTED]>
10/29/2003 01:18 AM
Please respond to "Struts Users Mailing List"

 
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
cc: 
Subject:Help please -- How to provide a "Back" button?


Dear all,

Question 1:

How to provide a Back button on a page?

Is there a html tag like the one for Cancel button:  ?

Question 2:

How to provide two submit buttons on one JSP page,
when click on the 1st button, the page is submitted to 1st action,
when click on the 2nd button, it's submitted to 2nd action?

Any response will be appreciated.
Thanks.

bruce



Re: Help with using HttpUnit with Struts

2003-10-22 Thread Craig R. McClanahan
Moyer, Alan L wrote:

I've got some more information that may help solve my problem.

 

The fact that you're seeing different behavior when executing things 
manually versus when accessing via HttpUnit means you're not executing 
the same code paths on the server side.  Remember, the server has no 
clue what kind of client you are -- it just sees an HTTP request.

One potential area of difference to investigate (if you're executing 
more than one request, which it sounds like you are) is session 
management.  For manually accessed pages, the cookies or URL rewriting 
takes care of that for you.  With HttpUnit, you'll want to make sure 
that your client code executes multiple requests in the context of a 
single session if you want to simulate what an interactive user actually 
does.

The NPE in your stack trace is exactly what you would get if the Action 
that was executed returned a ForwardConfig that didn't have a "path" 
property set on it, so the question is how that happened, and which 
forward it was.  When faced with things like this, I've always found it 
easiest just to run Tomcat under a debugger (using the built-in JPDA 
support with something like NetBeans) and set a breakpoint on the line 
in question.  That way, you can examine the situation (and the stack of 
method calls that got you here) to figure out where the difference is.

Craig

PS:  An additional tool I've also found useful is HtmlUnit (at 
sourceforge) -- besides being an HTTP client, it also parses the 
response into a DOM-like structure that you can analyze to ensure that 
the correct elements are present, without worrying about irrelevant 
details like whitespace or the order that attributes were rendered in.

Using HttpUnit I am attempting to log onto the site. The login JSP page has
a simple form with action
/Switch?prefix=/main&page=/Login.do

I am using modules. The login JSP is in the default module and the action is
in the "main" module.
When I use a browser, after a successful login, the address bar changes to

http://localhost/Opal_Struts/Switch.do?prefix=/main&page=/Login.do

When using HttpUnit, this is the same URL in the request object in the
testGoodLogin method in my original email post. That is, the server returned
this URL. (There is a slight difference in that / is replaced with %F.
However, I've also tried substituting the above URL exactly with the same
result.) 

When the login form is submitted, I then get the formentioned error. Now,
what I observe is that if I enter this URL into my browser address bar and
do a submit, I get the exact same nullptr exception at the server.
I then tried hard coding another URL that appears in the browser address bar
when logged in and doing a submit using HttpUnit and I don't see the nullptr
exception and the server behaves normally (which is to redirect to a page
that says the session has expired - which is how the behavior is coded since
no session was created.)
The problem appears to be on the server side and is specific to the login
action where a switch is being made from the default module to the main
module. Both default and main modules have this switch action:


and the main module Login action is


 
 
 

I have a printout in the LoginAction execute method, and I see this printout
before the nullptr exception. I suspect the problem is in the forwards out
of this action.
Al

-Original Message-
From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 21, 2003 8:26 PM
To: Struts Users Mailing List
Subject: Re: Help with using HttpUnit with Struts
Kirk Wylie wrote:

 

Does this happen when you hit the page directly (i.e. not go through 
HttpUnit)?

   

That would be my advice too ... (loving HttpUnit :-).

You should get the same error, which is likely to be a  element 
that doesn't have a defined "path" attribute (which is what is being 
accessed on at line 441 of request processor.

Craig

 

Kirk Wylie
M7 Corporation
Moyer, Alan L wrote:

   

I recently downloaded HttpUnit and have been trying to use it to test a
working Struts application. If anyone is using HttpUnit, please help 
me get
by this problem. Following is a HttpUnit test method adopted from the
documentation:

public void testGoodLogin() throws Exception {
   WebConversation conversation = new WebConversation();
   WebRequest  request = new GetMethodWebRequest(
"http://localhost/Opal_Struts/jsp/index.jsp"; );
   WebResponse response = conversation.getResponse( request );
   WebForm loginForm = response.getForms()[0];
   request = loginForm.getRequest();
   System.out.println(request.toString());
   request.setParameter( "username", "foo" );  // Setting login
info into form
   request.setParameter( "password", "bar" );
   response = conversation.getResponse( request ); // Exception is
th

RE: Help with using HttpUnit with Struts

2003-10-22 Thread Moyer, Alan L
I've got some more information that may help solve my problem.

Using HttpUnit I am attempting to log onto the site. The login JSP page has
a simple form with action

/Switch?prefix=/main&page=/Login.do

I am using modules. The login JSP is in the default module and the action is
in the "main" module.

When I use a browser, after a successful login, the address bar changes to

http://localhost/Opal_Struts/Switch.do?prefix=/main&page=/Login.do

When using HttpUnit, this is the same URL in the request object in the
testGoodLogin method in my original email post. That is, the server returned
this URL. (There is a slight difference in that / is replaced with %F.
However, I've also tried substituting the above URL exactly with the same
result.) 

When the login form is submitted, I then get the formentioned error. Now,
what I observe is that if I enter this URL into my browser address bar and
do a submit, I get the exact same nullptr exception at the server.

I then tried hard coding another URL that appears in the browser address bar
when logged in and doing a submit using HttpUnit and I don't see the nullptr
exception and the server behaves normally (which is to redirect to a page
that says the session has expired - which is how the behavior is coded since
no session was created.)

The problem appears to be on the server side and is specific to the login
action where a switch is being made from the default module to the main
module. Both default and main modules have this switch action:




and the main module Login action is


  
  
  


I have a printout in the LoginAction execute method, and I see this printout
before the nullptr exception. I suspect the problem is in the forwards out
of this action.

Al

-Original Message-
From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 21, 2003 8:26 PM
To: Struts Users Mailing List
Subject: Re: Help with using HttpUnit with Struts


Kirk Wylie wrote:

> Does this happen when you hit the page directly (i.e. not go through 
> HttpUnit)?
>

That would be my advice too ... (loving HttpUnit :-).

You should get the same error, which is likely to be a  element 
that doesn't have a defined "path" attribute (which is what is being 
accessed on at line 441 of request processor.

Craig


> Kirk Wylie
> M7 Corporation
>
> Moyer, Alan L wrote:
>
>> I recently downloaded HttpUnit and have been trying to use it to test a
>> working Struts application. If anyone is using HttpUnit, please help 
>> me get
>> by this problem. Following is a HttpUnit test method adopted from the
>> documentation:
>>
>> public void testGoodLogin() throws Exception {
>> WebConversation conversation = new WebConversation();
>> WebRequest  request = new GetMethodWebRequest(
>> "http://localhost/Opal_Struts/jsp/index.jsp"; );
>> WebResponse response = conversation.getResponse( request );
>> WebForm loginForm = response.getForms()[0];
>> request = loginForm.getRequest();
>> System.out.println(request.toString());
>> request.setParameter( "username", "foo" );  // Setting login
>> info into form
>> request.setParameter( "password", "bar" );
>> response = conversation.getResponse( request ); // Exception is
>> thrown in this call
>> // ...
>> }
>>
>> When this executes, an exception is thrown where indicated with text 
>> "Error
>> on HTTP request: 500 Internal Error"
>>
>> My server, running locally, shows the following exception in the 
>> console:
>>
>><101017>
>> <[ServletContext(id=351156
>> 2,name=Opal_Struts,context-path=/Opal_Struts)] Root cause of
>> ServletException
>> java.lang.NullPointerException
>> at
>> org.apache.struts.action.RequestProcessor.processForwardConfig(Reques
>> tProcessor.java:441)
>> at
>> org.apache.struts.action.RequestProcessor.process(RequestProcessor.ja
>> va:279)
>> at
>> org.apache.struts.action.ActionServlet.process(ActionServlet.java:148
>> 2)
>> at
>> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
>>
>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>> (snip)
>>
>> I get the same 500 error when contacting the same application running on
>> another server.
>>
>> Any idea what's going on and how to get past this?
>>
>> Thanks,
>>
>> Al
>>
>> -- 
>> This transmission is intended only for use by 

Re: Help with URL localization (continued)

2003-10-22 Thread Ruth, Brice
Jason Lea wrote:

Ruth, Brice wrote:

This seems like a good idea, but I think it would prevent the country 
code from always being available in the URL (so if you're in the US 
site, you should always see /US/index.do, etc.) unless I can do this 
within the Tomcat/Servlet interaction, w/o issuing a redirect to the 
browser?! Can chain.doFilter() send the request to an action other 
than what was initially invoked by the browser?
 

Yes, the filter catches the request before it is passed to the servlet 
so you can do pretty much anything you like including sending the 
request to a different action.  But the redirect is usually server 
side, so the browser would see the original URL.

So the problem comes back to getting the links to include the country 
code.

Here are 2 ways...

1. (probably involves the most work)  Create some new JSP tags using 
the Struts tags a base.  You need to do almost the same thing but 
insert that country code at the start of the link.  Then you can use 
some text, 
which would create a link with url '/US/crafts/crafts.do'

2.  (this might work staight off, and doesn't look too bad) Using JSTL 
and the Struts-EL tags...
some 
text

Though i think struts puts the locale into the session under the name 
|'org.apache.struts.action.LOCALE', so you might| need to put a copy 
(in your filter)
into session under a shorter name - or even just the country code that 
you are using.  Eg put into session as 'urlprefix' and 

The only thing you are losing here is you are not linking to the 
action name ('crafts/crafts'), you have to link to the url name 
'crafts/crafts.do'.  So if you changed the servlet mapping from '*.do' 
to '/do' you would have to change the links.
#2 is what I have currently implemented. Though the way that some other 
aspects are going, I may end up creating my own extension of the Struts 
HTML tag set for other reasons, at which point, I'll probably go ahead 
an implement #1.

Thanks for the excellent feedback!!

Brice

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


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


RE: Help with using HttpUnit with Struts

2003-10-22 Thread Moyer, Alan L
When I use a browser (IE or Netscape) I do not experience any problem.

Al

-Original Message-
From: Kirk Wylie [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 21, 2003 7:55 PM
To: Struts Users Mailing List
Subject: Re: Help with using HttpUnit with Struts


Does this happen when you hit the page directly (i.e. not go through 
HttpUnit)?

Kirk Wylie
M7 Corporation

Moyer, Alan L wrote:

> I recently downloaded HttpUnit and have been trying to use it to test a
> working Struts application. If anyone is using HttpUnit, please help me
get
> by this problem. Following is a HttpUnit test method adopted from the
> documentation:
> 
> public void testGoodLogin() throws Exception {
> WebConversation conversation = new WebConversation();
> WebRequest  request = new GetMethodWebRequest(
> "http://localhost/Opal_Struts/jsp/index.jsp"; );
> WebResponse response = conversation.getResponse( request );
> WebForm loginForm = response.getForms()[0];
> request = loginForm.getRequest();
> System.out.println(request.toString());
> request.setParameter( "username", "foo" );  // Setting login
> info into form
> request.setParameter( "password", "bar" );
> response = conversation.getResponse( request ); // Exception is
> thrown in this call
> // ...
> }
> 
> When this executes, an exception is thrown where indicated with text
"Error
> on HTTP request: 500 Internal Error"
> 
> My server, running locally, shows the following exception in the console:
> 
><101017>
> <[ServletContext(id=351156
> 2,name=Opal_Struts,context-path=/Opal_Struts)] Root cause of
> ServletException
> java.lang.NullPointerException
> at
> org.apache.struts.action.RequestProcessor.processForwardConfig(Reques
> tProcessor.java:441)
> at
> org.apache.struts.action.RequestProcessor.process(RequestProcessor.ja
> va:279)
> at
> org.apache.struts.action.ActionServlet.process(ActionServlet.java:148
> 2)
> at
> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
> 
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> (snip)
> 
> I get the same 500 error when contacting the same application running on
> another server.
> 
> Any idea what's going on and how to get past this?
> 
> Thanks,
> 
> Al
> 
> -- 
> This transmission is intended only for use by the addressee(s) named 
> herein and may contain information that is proprietary, confidential 
> and/or legally privileged. If you are not the intended recipient, you 
> are hereby notified that any disclosure, copying, distribution, or use 
> of the information contained herein (including any reliance thereon) is 
> STRICTLY PROHIBITED. If you received this transmission in error, please 
> immediately contact the sender and destroy the material in its entirety, 
> whether in electronic or hard copy format. Thank you.
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


--
This transmission is intended only for use by the addressee(s) named herein and may 
contain information that is proprietary, confidential and/or legally privileged. If 
you are not the intended recipient, you are hereby notified that any disclosure, 
copying, distribution, or use of the information contained herein (including any 
reliance thereon) is STRICTLY PROHIBITED. If you received this transmission in error, 
please immediately contact the sender and destroy the material in its entirety, 
whether in electronic or hard copy format. Thank you.



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



RE: Help needed on Iterate Tag

2003-10-22 Thread Rajat Pandit
Huh?

-Original Message-
From: Abhijeet Mahalkar [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 22, 2003 3:46 AM
To: Struts Users Mailing List; WebSphere User Group Tech Q & A Forum
Subject: Re: Help needed on Iterate Tag


Aapko Naye Saal me...

Chandragupt Ki Shakti
 Meerabai Ki Bhakti

 Ramchandra Ka Gyan
Karan Ka Daan

 Einstein Ki Buddhi
Nobel Prize Ki Siddhi

  Gandhi Ki Ahimsa
 India Ki Parampara

 Vajpayee Ki Maryada
  Nizaam Ki Sampada

  Michael Jordan Ki Salary
  Abdul Kalam Ki Vocabulary

  Bhagat Singh Ka Deshprem
   Sweetheart Ka Amarprem

 Microsoft Ke Share
   Rupiyo Ke Dher

   Tata Ke Senses
 Ambani Ke Licenses

   Birla Ka Bangla
  Daler Ka Bhangra

  Amitabh Ki Style
  Madhuri Ki Smile

   Shahrukh Ki Personality
   Aishwarya Ki Popularity

 Worldtour Ka Ticket
 Tendulkar Ka Wicket

 Administrator Ke Passwords
  Jokes Ke Forwards

   Mercedez Ki Car
   Diamond Ka Haar

Aur Logon Ka Dher Saraa Pyar Prapt  Ho...

   Wish you a Happy Diwali and a Prosperous New Year

Regards
Abhijeet Mahalkar




-
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: Help needed on Iterate Tag

2003-10-22 Thread Kalra, Ashwani
It also gives this error for various other problems,Which are difficult to
debug.For eg if the element obtained is null, then also it gives the same
error. So use  before printing its value.

/Regds
Ashwani

>-Original Message-
>From: Thakur, Vikram [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, October 22, 2003 2:34 PM
>To: 'Struts Users Mailing List'
>Subject: RE: Help needed on Iterate Tag
>
>
>Thanks everyone.
>There was no problem with the tag but I had not defined the 
><%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %> 
>entry and that
>is why it was
>not working :(
>
>Thanks,
>Vikram
>
>
>
>-Original Message-
>From: David Molinier [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, October 22, 2003 2:13 PM
>To: Struts Users Mailing List
>Subject: Re: Help needed on Iterate Tag
>
>
>
>Try this :
>
>
>   
>
>
>--
>David Molinier - PagesJaunes - DSI/DET/DCR 3 - 05.56.90.50.03 <*>
>
>
>- Original Message -----
>From: "Thakur, Vikram" <[EMAIL PROTECTED]>
>To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
>Sent: Wednesday, October 22, 2003 7:33 AM
>Subject: RE: Help needed on Iterate Tag
>
>
>> Hi Navjot,
>> This is the error message that I get,
>> Error 500: Cannot find bean element in any scope
>>
>> This is the code in jsp ,
>> 
>>
>> 
>>
>> and this is the code in form bean,
>>
>> public Collection getNames() {
>> return names;
>> }
>>
>> Thanks,
>> Vikram
>>
>> -Original Message-
>> From: Navjot Singh [mailto:[EMAIL PROTECTED]
>> Sent: Wednesday, October 22, 2003 10:12 AM
>> To: Struts Users Mailing List
>> Subject: RE: Help needed on Iterate Tag
>>
>>
>> can you post the error?
>>
>> >-Original Message-
>> >From: Thakur, Vikram [mailto:[EMAIL PROTECTED]
>> >Sent: Wednesday, October 22, 2003 10:04 AM
>> >To: 'Struts Users Mailing List'
>> >Subject: RE: Help needed on Iterate Tag
>> >
>> >
>> >No It is not working..
>> >
>> >-Original Message-
>> >From: Navjot Singh [mailto:[EMAIL PROTECTED]
>> >Sent: Wednesday, October 22, 2003 9:54 AM
>> >To: Struts Users Mailing List
>> >Subject: RE: Help needed on Iterate Tag
>> >
>> >
>> >quick try - try replacing Names with names in iterate tag
>> >
>> >
>> >>-Original Message-
>> >>From: Thakur, Vikram [mailto:[EMAIL PROTECTED]
>> >>Sent: Wednesday, October 22, 2003 9:55 AM
>> >>To: Struts (E-mail)
>> >>Subject: Help needed on Iterate Tag
>> >>
>> >>
>> >>Hi ,
>> >> I have Collection of  Strings and I want to print all the 
>values in
>> >>this collection using Iterate Tag.
>> >> Any guidelines how do I do this ??
>> >>
>> >> I had tried to implement it as follows but it is not working.
>> >>
>> >> property="Names">
>> >>   
>> >> 
>> >>
>> >> Here the getNames() method of my form bean returns a Collection of
>> >>Strings.
>> >> The bean:write method tries to search for FormBean with "element"
>> >>and I get error.
>> >> I would really appreciate If someone can help me on this.
>> >>
>> >>Thanks,
>> >>Vikram
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>This message contains information that may be privileged or
>> >>confidential and
>> >>is the property of the Cap Gemini Ernst & Young Group. It 
>is intended
>only
>> >>for the person to whom it is addressed. If you are not the intended
>> >>recipient, you are not authorised to read, print, retain, copy,
>> >>disseminate,
>> >>distribute, or use this message or any part thereof. If 
>you receive this
>> >>message in error, please notify the sender immediately and delete
>> >>all copies
>> >>of this message.
>> >>
>> 
>>>-
>> >>To unsubscribe, e-mail: [EMAIL PROTECTED]
>> >>For additional commands, e-mail: 
>[EMAIL PROTECTED]
>> >>
>> >>
>> >
>> 
>&

Re: Help needed on Iterate Tag

2003-10-22 Thread Abhijeet Mahalkar
Aapko Naye Saal me...

Chandragupt Ki Shakti
 Meerabai Ki Bhakti

 Ramchandra Ka Gyan
Karan Ka Daan

 Einstein Ki Buddhi
Nobel Prize Ki Siddhi

  Gandhi Ki Ahimsa
 India Ki Parampara

 Vajpayee Ki Maryada
  Nizaam Ki Sampada

  Michael Jordan Ki Salary
  Abdul Kalam Ki Vocabulary

  Bhagat Singh Ka Deshprem
   Sweetheart Ka Amarprem

 Microsoft Ke Share
   Rupiyo Ke Dher

   Tata Ke Senses
 Ambani Ke Licenses

   Birla Ka Bangla
  Daler Ka Bhangra

  Amitabh Ki Style
  Madhuri Ki Smile

   Shahrukh Ki Personality
   Aishwarya Ki Popularity

 Worldtour Ka Ticket
 Tendulkar Ka Wicket

 Administrator Ke Passwords
  Jokes Ke Forwards

   Mercedez Ki Car
   Diamond Ka Haar

Aur Logon Ka Dher Saraa Pyar Prapt  Ho...

   Wish you a Happy Diwali and a Prosperous New Year

Regards
Abhijeet Mahalkar




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



RE: Help needed on Iterate Tag

2003-10-22 Thread Thakur, Vikram
Thanks everyone.
There was no problem with the tag but I had not defined the 
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %> entry and that
is why it was
not working :(

Thanks,
Vikram



-Original Message-
From: David Molinier [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 22, 2003 2:13 PM
To: Struts Users Mailing List
Subject: Re: Help needed on Iterate Tag



Try this :


   


--
David Molinier - PagesJaunes - DSI/DET/DCR 3 - 05.56.90.50.03 <*>


- Original Message -
From: "Thakur, Vikram" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Wednesday, October 22, 2003 7:33 AM
Subject: RE: Help needed on Iterate Tag


> Hi Navjot,
> This is the error message that I get,
> Error 500: Cannot find bean element in any scope
>
> This is the code in jsp ,
> 
>
> 
>
> and this is the code in form bean,
>
> public Collection getNames() {
> return names;
> }
>
> Thanks,
> Vikram
>
> -Original Message-
> From: Navjot Singh [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, October 22, 2003 10:12 AM
> To: Struts Users Mailing List
> Subject: RE: Help needed on Iterate Tag
>
>
> can you post the error?
>
> >-Original Message-
> >From: Thakur, Vikram [mailto:[EMAIL PROTECTED]
> >Sent: Wednesday, October 22, 2003 10:04 AM
> >To: 'Struts Users Mailing List'
> >Subject: RE: Help needed on Iterate Tag
> >
> >
> >No It is not working..
> >
> >-Original Message-
> >From: Navjot Singh [mailto:[EMAIL PROTECTED]
> >Sent: Wednesday, October 22, 2003 9:54 AM
> >To: Struts Users Mailing List
> >Subject: RE: Help needed on Iterate Tag
> >
> >
> >quick try - try replacing Names with names in iterate tag
> >
> >
> >>-Original Message-
> >>From: Thakur, Vikram [mailto:[EMAIL PROTECTED]
> >>Sent: Wednesday, October 22, 2003 9:55 AM
> >>To: Struts (E-mail)
> >>Subject: Help needed on Iterate Tag
> >>
> >>
> >>Hi ,
> >> I have Collection of  Strings and I want to print all the values in
> >>this collection using Iterate Tag.
> >> Any guidelines how do I do this ??
> >>
> >> I had tried to implement it as follows but it is not working.
> >>
> >> 
> >>   
> >> 
> >>
> >> Here the getNames() method of my form bean returns a Collection of
> >>Strings.
> >> The bean:write method tries to search for FormBean with "element"
> >>and I get error.
> >> I would really appreciate If someone can help me on this.
> >>
> >>Thanks,
> >>Vikram
> >>
> >>
> >>
> >>
> >>
> >>This message contains information that may be privileged or
> >>confidential and
> >>is the property of the Cap Gemini Ernst & Young Group. It is intended
only
> >>for the person to whom it is addressed. If you are not the intended
> >>recipient, you are not authorised to read, print, retain, copy,
> >>disseminate,
> >>distribute, or use this message or any part thereof. If you receive this
> >>message in error, please notify the sender immediately and delete
> >>all copies
> >>of this message.
> >>
> >>-
> >>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]
> >
> >
> >This message contains information that may be privileged or
> >confidential and
> >is the property of the Cap Gemini Ernst & Young Group. It is intended
only
> >for the person to whom it is addressed. If you are not the intended
> >recipient, you are not authorised to read, print, retain, copy,
> >disseminate,
> >distribute, or use this message or any part thereof. If you receive this
> >message in error, please notify the sender immediately and delete
> >all copies
> >of this message.
> >
> >-
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >

Re: Help needed on Iterate Tag

2003-10-22 Thread David Molinier

Try this :


   


--
David Molinier - PagesJaunes - DSI/DET/DCR 3 - 05.56.90.50.03 <*>


- Original Message -
From: "Thakur, Vikram" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Wednesday, October 22, 2003 7:33 AM
Subject: RE: Help needed on Iterate Tag


> Hi Navjot,
> This is the error message that I get,
> Error 500: Cannot find bean element in any scope
>
> This is the code in jsp ,
> 
>
> 
>
> and this is the code in form bean,
>
> public Collection getNames() {
> return names;
> }
>
> Thanks,
> Vikram
>
> -Original Message-
> From: Navjot Singh [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, October 22, 2003 10:12 AM
> To: Struts Users Mailing List
> Subject: RE: Help needed on Iterate Tag
>
>
> can you post the error?
>
> >-Original Message-
> >From: Thakur, Vikram [mailto:[EMAIL PROTECTED]
> >Sent: Wednesday, October 22, 2003 10:04 AM
> >To: 'Struts Users Mailing List'
> >Subject: RE: Help needed on Iterate Tag
> >
> >
> >No It is not working..
> >
> >-Original Message-
> >From: Navjot Singh [mailto:[EMAIL PROTECTED]
> >Sent: Wednesday, October 22, 2003 9:54 AM
> >To: Struts Users Mailing List
> >Subject: RE: Help needed on Iterate Tag
> >
> >
> >quick try - try replacing Names with names in iterate tag
> >
> >
> >>-Original Message-
> >>From: Thakur, Vikram [mailto:[EMAIL PROTECTED]
> >>Sent: Wednesday, October 22, 2003 9:55 AM
> >>To: Struts (E-mail)
> >>Subject: Help needed on Iterate Tag
> >>
> >>
> >>Hi ,
> >> I have Collection of  Strings and I want to print all the values in
> >>this collection using Iterate Tag.
> >> Any guidelines how do I do this ??
> >>
> >> I had tried to implement it as follows but it is not working.
> >>
> >> 
> >>   
> >> 
> >>
> >> Here the getNames() method of my form bean returns a Collection of
> >>Strings.
> >> The bean:write method tries to search for FormBean with "element"
> >>and I get error.
> >> I would really appreciate If someone can help me on this.
> >>
> >>Thanks,
> >>Vikram
> >>
> >>
> >>
> >>
> >>
> >>This message contains information that may be privileged or
> >>confidential and
> >>is the property of the Cap Gemini Ernst & Young Group. It is intended
only
> >>for the person to whom it is addressed. If you are not the intended
> >>recipient, you are not authorised to read, print, retain, copy,
> >>disseminate,
> >>distribute, or use this message or any part thereof. If you receive this
> >>message in error, please notify the sender immediately and delete
> >>all copies
> >>of this message.
> >>
> >>-
> >>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]
> >
> >
> >This message contains information that may be privileged or
> >confidential and
> >is the property of the Cap Gemini Ernst & Young Group. It is intended
only
> >for the person to whom it is addressed. If you are not the intended
> >recipient, you are not authorised to read, print, retain, copy,
> >disseminate,
> >distribute, or use this message or any part thereof. If you receive this
> >message in error, please notify the sender immediately and delete
> >all copies
> >of this message.
> >
> >-
> >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]
>
> 
> This message contains information that may be privileged or confidential
and
> is the property of the Cap Gemini Ernst & Young Group. It is intended only
> for the person to whom it is addressed. If you are not the intended
> recipient, you are not authorised to read, print, retain, copy,
disseminate,
> distribute, or use this message or any part thereof. If you receive this
> message in error, please notify the sender immediately and delete all
copies
> of this message.
>
> -
> 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: Help needed on Iterate Tag

2003-10-21 Thread Thakur, Vikram
Hi Navjot,
This is the error message that I get,
Error 500: Cannot find bean element in any scope 

This is the code in jsp ,

   


and this is the code in form bean,

public Collection getNames(){
return names;
}

Thanks,
Vikram

-Original Message-
From: Navjot Singh [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 22, 2003 10:12 AM
To: Struts Users Mailing List
Subject: RE: Help needed on Iterate Tag


can you post the error?

>-Original Message-
>From: Thakur, Vikram [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, October 22, 2003 10:04 AM
>To: 'Struts Users Mailing List'
>Subject: RE: Help needed on Iterate Tag
>
>
>No It is not working..
>
>-Original Message-
>From: Navjot Singh [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, October 22, 2003 9:54 AM
>To: Struts Users Mailing List
>Subject: RE: Help needed on Iterate Tag
>
>
>quick try - try replacing Names with names in iterate tag
>
>
>>-Original Message-
>>From: Thakur, Vikram [mailto:[EMAIL PROTECTED]
>>Sent: Wednesday, October 22, 2003 9:55 AM
>>To: Struts (E-mail)
>>Subject: Help needed on Iterate Tag
>>
>>
>>Hi ,
>>  I have Collection of  Strings and I want to print all the values in
>>this collection using Iterate Tag.
>>  Any guidelines how do I do this ??
>>
>>  I had tried to implement it as follows but it is not working.
>>
>>  
>>
>>  
>>
>>  Here the getNames() method of my form bean returns a Collection of
>>Strings.
>>  The bean:write method tries to search for FormBean with "element"
>>and I get error.
>>  I would really appreciate If someone can help me on this.
>>
>>Thanks,
>>Vikram
>>
>>
>>
>>
>>
>>This message contains information that may be privileged or
>>confidential and
>>is the property of the Cap Gemini Ernst & Young Group. It is intended only
>>for the person to whom it is addressed. If you are not the intended
>>recipient, you are not authorised to read, print, retain, copy,
>>disseminate,
>>distribute, or use this message or any part thereof. If you receive this
>>message in error, please notify the sender immediately and delete
>>all copies
>>of this message.
>>
>>-
>>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]
>
>
>This message contains information that may be privileged or
>confidential and
>is the property of the Cap Gemini Ernst & Young Group. It is intended only
>for the person to whom it is addressed. If you are not the intended
>recipient, you are not authorised to read, print, retain, copy,
>disseminate,
>distribute, or use this message or any part thereof. If you receive this
>message in error, please notify the sender immediately and delete
>all copies
>of this message.
>
>-
>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]


This message contains information that may be privileged or confidential and
is the property of the Cap Gemini Ernst & Young Group. It is intended only
for the person to whom it is addressed. If you are not the intended
recipient, you are not authorised to read, print, retain, copy, disseminate,
distribute, or use this message or any part thereof. If you receive this
message in error, please notify the sender immediately and delete all copies
of this message.

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



RE: Help needed on Iterate Tag

2003-10-21 Thread Navjot Singh
can you post the error?

>-Original Message-
>From: Thakur, Vikram [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, October 22, 2003 10:04 AM
>To: 'Struts Users Mailing List'
>Subject: RE: Help needed on Iterate Tag
>
>
>No It is not working..
>
>-Original Message-
>From: Navjot Singh [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, October 22, 2003 9:54 AM
>To: Struts Users Mailing List
>Subject: RE: Help needed on Iterate Tag
>
>
>quick try - try replacing Names with names in iterate tag
>
>
>>-Original Message-
>>From: Thakur, Vikram [mailto:[EMAIL PROTECTED]
>>Sent: Wednesday, October 22, 2003 9:55 AM
>>To: Struts (E-mail)
>>Subject: Help needed on Iterate Tag
>>
>>
>>Hi ,
>>  I have Collection of  Strings and I want to print all the values in
>>this collection using Iterate Tag.
>>  Any guidelines how do I do this ??
>>
>>  I had tried to implement it as follows but it is not working.
>>
>>  
>>
>>  
>>
>>  Here the getNames() method of my form bean returns a Collection of
>>Strings.
>>  The bean:write method tries to search for FormBean with "element"
>>and I get error.
>>  I would really appreciate If someone can help me on this.
>>
>>Thanks,
>>Vikram
>>
>>
>>
>>
>>
>>This message contains information that may be privileged or
>>confidential and
>>is the property of the Cap Gemini Ernst & Young Group. It is intended only
>>for the person to whom it is addressed. If you are not the intended
>>recipient, you are not authorised to read, print, retain, copy,
>>disseminate,
>>distribute, or use this message or any part thereof. If you receive this
>>message in error, please notify the sender immediately and delete
>>all copies
>>of this message.
>>
>>-
>>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]
>
>
>This message contains information that may be privileged or
>confidential and
>is the property of the Cap Gemini Ernst & Young Group. It is intended only
>for the person to whom it is addressed. If you are not the intended
>recipient, you are not authorised to read, print, retain, copy,
>disseminate,
>distribute, or use this message or any part thereof. If you receive this
>message in error, please notify the sender immediately and delete
>all copies
>of this message.
>
>-
>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: Help needed on Iterate Tag

2003-10-21 Thread Puneet Agarwal

Vikram,
Navjot said the right thing it may not work with Names but with names.
You can try another thing


  


Regards,
Puneet Agarwal

Tata Consultancy Services,
C-56, Phase - II, NOIDA 201305 (India)
Phone: +91-120-2461001, 2, 7, 8, 9, 12, 13 (Ext. 1044)
FAX              : +91-120-246 1521

Struts ... Action ... Struts in Action ... Action in Struts ...


   
 
"Thakur,   
 
Vikram"   To: "'Struts Users Mailing List'" 
<[EMAIL PROTECTED]>
        Subject: RE: Help needed on  Iterate Tag 
 
   
 
10/22/03 10:03 
 
AM 
 
Please respond 
 
to "Struts 
 
Users Mailing  
 
List"  
 
   
 
   
 




No It is not working..

-Original Message-
From: Navjot Singh [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 22, 2003 9:54 AM
To: Struts Users Mailing List
Subject: RE: Help needed on Iterate Tag


quick try - try replacing Names with names in iterate tag


>-Original Message-
>From: Thakur, Vikram [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, October 22, 2003 9:55 AM
>To: Struts (E-mail)
>Subject: Help needed on Iterate Tag
>
>
>Hi ,
>I have Collection of  Strings and I want to print all the values in
>this collection using Iterate Tag.
>Any guidelines how do I do this ??
>
>I had tried to implement it as follows but it is not working.
>
>
>  
>
>
>Here the getNames() method of my form bean returns a Collection of
>Strings.
>The bean:write method tries to search for FormBean with "element"
>and I get error.
>I would really appreciate If someone can help me on this.
>
>Thanks,
>Vikram
>
>
>
>
>
>This message contains information that may be privileged or
>confidential and
>is the property of the Cap Gemini Ernst & Young Group. It is intended only
>for the person to whom it is addressed. If you are not the intended
>recipient, you are not authorised to read, print, retain, copy,
>disseminate,
>distribute, or use this message or any part thereof. If you receive this
>message in error, please notify the sender immediately and delete
>all copies
>of this message.
>
>-
>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]


This message contains information that may be privileged or confidential
and
is the property of the Cap Gemini Ernst & Young Group. It is intended only
for the person to whom it is addressed. If you are not the intended
recipient, you are not authorised to read, print, retain, copy,
disseminate,
distribute, or use this message or any part thereof. If you receive this
message in error, please notify the sender immediately and delete all
copies
of this message.

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




DISCLAIMER: The information contained in this message is intended only and
solely for the addressed individual or entity indicated in this message and
for the exclusive use of the said addressed individual or entity indicated
in this message (or responsible for delivery of the message to such person)
and may contain legally privileged and confidential information belonging
to Tata Consultancy Services. 

RE: Help needed on Iterate Tag

2003-10-21 Thread Thakur, Vikram
No It is not working..

-Original Message-
From: Navjot Singh [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 22, 2003 9:54 AM
To: Struts Users Mailing List
Subject: RE: Help needed on Iterate Tag


quick try - try replacing Names with names in iterate tag


>-Original Message-
>From: Thakur, Vikram [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, October 22, 2003 9:55 AM
>To: Struts (E-mail)
>Subject: Help needed on Iterate Tag
>
>
>Hi ,
>   I have Collection of  Strings and I want to print all the values in
>this collection using Iterate Tag.
>   Any guidelines how do I do this ??
>   
>   I had tried to implement it as follows but it is not working.
>
>   
> 
>   
>
>   Here the getNames() method of my form bean returns a Collection of
>Strings.
>   The bean:write method tries to search for FormBean with "element"
>and I get error.
>   I would really appreciate If someone can help me on this.
>
>Thanks,
>Vikram
>   
>   
>   
>
>
>This message contains information that may be privileged or 
>confidential and
>is the property of the Cap Gemini Ernst & Young Group. It is intended only
>for the person to whom it is addressed. If you are not the intended
>recipient, you are not authorised to read, print, retain, copy, 
>disseminate,
>distribute, or use this message or any part thereof. If you receive this
>message in error, please notify the sender immediately and delete 
>all copies
>of this message.
>
>-
>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]


This message contains information that may be privileged or confidential and
is the property of the Cap Gemini Ernst & Young Group. It is intended only
for the person to whom it is addressed. If you are not the intended
recipient, you are not authorised to read, print, retain, copy, disseminate,
distribute, or use this message or any part thereof. If you receive this
message in error, please notify the sender immediately and delete all copies
of this message.

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



RE: Help needed on Iterate Tag

2003-10-21 Thread Navjot Singh
quick try - try replacing Names with names in iterate tag


>-Original Message-
>From: Thakur, Vikram [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, October 22, 2003 9:55 AM
>To: Struts (E-mail)
>Subject: Help needed on Iterate Tag
>
>
>Hi ,
>   I have Collection of  Strings and I want to print all the values in
>this collection using Iterate Tag.
>   Any guidelines how do I do this ??
>   
>   I had tried to implement it as follows but it is not working.
>
>   
> 
>   
>
>   Here the getNames() method of my form bean returns a Collection of
>Strings.
>   The bean:write method tries to search for FormBean with "element"
>and I get error.
>   I would really appreciate If someone can help me on this.
>
>Thanks,
>Vikram
>   
>   
>   
>
>
>This message contains information that may be privileged or 
>confidential and
>is the property of the Cap Gemini Ernst & Young Group. It is intended only
>for the person to whom it is addressed. If you are not the intended
>recipient, you are not authorised to read, print, retain, copy, 
>disseminate,
>distribute, or use this message or any part thereof. If you receive this
>message in error, please notify the sender immediately and delete 
>all copies
>of this message.
>
>-
>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: Help with URL localization (continued)

2003-10-21 Thread Jason Lea
Ruth, Brice wrote:

This seems like a good idea, but I think it would prevent the country 
code from always being available in the URL (so if you're in the US 
site, you should always see /US/index.do, etc.) unless I can do this 
within the Tomcat/Servlet interaction, w/o issuing a redirect to the 
browser?! Can chain.doFilter() send the request to an action other than 
what was initially invoked by the browser?
 

Yes, the filter catches the request before it is passed to the servlet 
so you can do pretty much anything you like including sending the 
request to a different action.  But the redirect is usually server side, 
so the browser would see the original URL.

So the problem comes back to getting the links to include the country code.

Here are 2 ways...

1. (probably involves the most work)  Create some new JSP tags using the 
Struts tags a base.  You need to do almost the same thing but insert 
that country code at the start of the link.  Then you can use 
some text, 
which would create a link with url '/US/crafts/crafts.do'

2.  (this might work staight off, and doesn't look too bad) Using JSTL 
and the Struts-EL tags...
some 
text

Though i think struts puts the locale into the session under the name 
|'org.apache.struts.action.LOCALE', so you might| need to put a copy (in 
your filter)
into session under a shorter name - or even just the country code that 
you are using.  Eg put into session as 'urlprefix' and 

The only thing you are losing here is you are not linking to the action 
name ('crafts/crafts'), you have to link to the url name 
'crafts/crafts.do'.  So if you changed the servlet mapping from '*.do' 
to '/do' you would have to change the links.

Brice

Jason Lea wrote:

 

Here is a thought...

Set up your action mappings in struts-config.xml without the domain 
prefix eg
  /index.do
  /crafts/crafts.do

Then in your filter you can check for the locale prefix and set the 
locale.  In the same filter, construct a new path by removing the 
locale prefix and forward to the remainder of the path

eg request is /de/index.do --> redirect to /index.do

Struts will then match this and forward to the correct action.
If the request doesn't contain a matching locale then just let the 
request pass through.  eg /crafts/crafts.do would be let through 
unchanged as the 'crafts. does not match a locale.  As the first 
request should set the locale, you may not need to include it in any 
subsequent requests so .jsps can link to /index.do instead of 
/de/index.do

eg
request #1:  /de/index.do  (filter sets locale to de)
request #2: /crafts/crafts.do (uses locale already set to de)
Hmm, you could even change the filter mapping so it is only invoked 
for the locales that you are covering eg
/de/*
/fr/*

Then you won't have to do let through any unmatched locales eg 
/crafts/crafts.do would not be checked by the filter, but 
/fr/crafts/crafts.do is caught, locale set and redirected to 
/crafts/crafts.do

Ruth, Brice wrote:

   

The straightforward wildcarding didn't seem to work (it matched 
against a literal wildcard). Just an FYI for others, I guess .. :)

Adam Hardy wrote:



 

Hi Brice,
wasn't long before you came back! I was holding out thinking someone 
else might have a more intuitive solution than mine, but whatever, 
in your position I write my own taglib based on the html link taglib 
& add in the locale to the URL in that.

As for the action mappings, I think you're going to have to test it 
to see if you can use patterns. The struts gurus seem to be keeping 
their heads down, but maybe one of them will chime in.

Adam

On 10/21/2003 05:40 PM Ruth, Brice wrote:

 

   

Greetings.

As per my previous thread on the best way to create a URL structure 
like:

http://domain/us/whatever
http://domain/de/whatever
etc.
I've implemented the recommendations I received and now have a 
Filter listening to each request and setting the locale 
appropriately based on the country code specified in the URL. 
Working great :) I also have the .jsp I'm working with mapped to an 
action with a path like /us/index.do.

Now, within this index page, I have links in my navigation, being 
generated by the Struts HTML tags (html:link) - how would I best go 
about incorporating the country URL prefix (/us/, /de/, /fr/, etc.) 
without manually having to insert something like  - also, instead of setting up an 
action for each .jsp, for each language (/us/index.do; 
/de/index.do; /us/crafts/crafts.do; /de/crafts/crafts.do; etc.) - 
what's a better way of doing this? Can I create an action using 
org.apache.struts.actions.ForwardAction that uses a wildcard? So 
something like /*/index.do would have a parameter of /index.jsp and 
/*/crafts/crafts.do would have a parameter of /crafts/crafts.jsp.

I'm looking for guidance - best way of accomplishing my goals of 
code-reuse, ease-of-maintenance, as well as being able to provide 
the flexibility in URL naming that marketing would like to see.

Thanks,
Brice
   
  

Re: Help with URL localization (continued)

2003-10-21 Thread Ruth, Brice
This seems like a good idea, but I think it would prevent the country 
code from always being available in the URL (so if you're in the US 
site, you should always see /US/index.do, etc.) unless I can do this 
within the Tomcat/Servlet interaction, w/o issuing a redirect to the 
browser?! Can chain.doFilter() send the request to an action other than 
what was initially invoked by the browser?

Brice

Jason Lea wrote:

Here is a thought...

Set up your action mappings in struts-config.xml without the domain 
prefix eg
   /index.do
   /crafts/crafts.do

Then in your filter you can check for the locale prefix and set the 
locale.  In the same filter, construct a new path by removing the 
locale prefix and forward to the remainder of the path

eg request is /de/index.do --> redirect to /index.do

Struts will then match this and forward to the correct action.
If the request doesn't contain a matching locale then just let the 
request pass through.  eg /crafts/crafts.do would be let through 
unchanged as the 'crafts. does not match a locale.  As the first 
request should set the locale, you may not need to include it in any 
subsequent requests so .jsps can link to /index.do instead of 
/de/index.do

eg
request #1:  /de/index.do  (filter sets locale to de)
request #2: /crafts/crafts.do (uses locale already set to de)
Hmm, you could even change the filter mapping so it is only invoked 
for the locales that you are covering eg
/de/*
/fr/*

Then you won't have to do let through any unmatched locales eg 
/crafts/crafts.do would not be checked by the filter, but 
/fr/crafts/crafts.do is caught, locale set and redirected to 
/crafts/crafts.do

Ruth, Brice wrote:

The straightforward wildcarding didn't seem to work (it matched 
against a literal wildcard). Just an FYI for others, I guess .. :)

Adam Hardy wrote:

 

Hi Brice,
wasn't long before you came back! I was holding out thinking someone 
else might have a more intuitive solution than mine, but whatever, 
in your position I write my own taglib based on the html link taglib 
& add in the locale to the URL in that.

As for the action mappings, I think you're going to have to test it 
to see if you can use patterns. The struts gurus seem to be keeping 
their heads down, but maybe one of them will chime in.

Adam

On 10/21/2003 05:40 PM Ruth, Brice wrote:

  

Greetings.

As per my previous thread on the best way to create a URL structure 
like:

http://domain/us/whatever
http://domain/de/whatever
etc.
I've implemented the recommendations I received and now have a 
Filter listening to each request and setting the locale 
appropriately based on the country code specified in the URL. 
Working great :) I also have the .jsp I'm working with mapped to an 
action with a path like /us/index.do.

Now, within this index page, I have links in my navigation, being 
generated by the Struts HTML tags (html:link) - how would I best go 
about incorporating the country URL prefix (/us/, /de/, /fr/, etc.) 
without manually having to insert something like  - also, instead of setting up an 
action for each .jsp, for each language (/us/index.do; 
/de/index.do; /us/crafts/crafts.do; /de/crafts/crafts.do; etc.) - 
what's a better way of doing this? Can I create an action using 
org.apache.struts.actions.ForwardAction that uses a wildcard? So 
something like /*/index.do would have a parameter of /index.jsp and 
/*/crafts/crafts.do would have a parameter of /crafts/crafts.jsp.

I'm looking for guidance - best way of accomplishing my goals of 
code-reuse, ease-of-maintenance, as well as being able to provide 
the flexibility in URL naming that marketing would like to see.

Thanks,
Brice

  


 



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


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


  1   2   3   4   5   6   7   8   9   10   >