how to refresh only included pages

2008-03-28 Thread roshana

Hi all,
I am a newbie to java struts programming. Now I am working on a file upload
module which reads a text file, process it and port it to a database. The
progress of this operation is to be shown in a text area. 

Here I am using two Jsp files - first.jsp for allowing user to select the
file to be read and second.jsp for displaying the progress in a text area. I
am also using a form bean uploadActionForm and an action uploadAction for
performing the operation. The action-mapping has two forwards "success" and
"display". The "success" forwards some intermediate validation
results to first.jsp and the progress of operation via. the number of rows
inserted is forwarded to second.jsp through the action forward "display".

The  tag is used to control the display of both jsps. once the import
button is clicked, the second jsp is shown by



Till here it works..

And to get updated information on the number of rows so far inserted, I am
frequently refreshing second.jsp using condition based refreshing. A session
variable isProcessing it set to false when the operation is completed. 

And as far as isProcessing is true, the second.jsp is coded for continous
refresh. Here I want only the second.jsp to refresh. But the refresh works
for first.jsp and soon the page first.jsp is displayed..I can't see progress
of operation. Is there a way to refresh the included page only..

I have gone through a similar code in this forum...I was trying to implement
my code like this..

thanks.
roshana.
-- 
View this message in context: 
http://www.nabble.com/how-to-refresh-only-included-pages-tp16367325p16367325.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Client Side Validation with Struts

2008-03-28 Thread Asad Habib
Hello. I am validating data on the client-side using the Javascript
onsubmit event handler and this is working just fine. The problem I am
having is with trying to prevent the action from being called after
the alert window is closed. Is it possible to do this? If so, how?
Also, for client side validation with Struts, do I need to use the
validator? Any help would be appreciated. Thank you.

- Asad

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



Re: Compile error in JSP after upgrading from servlet specification 2.3 to 2.4

2008-03-28 Thread Laurie Harper

Ashish Kulkarni wrote:

Hi
I get compile error in jsp at line



There's nothing wrong with that line. What is the full error you're 
getting? What do the surrounding lines of your JSP look like?



I jsut upgraded web.xml from 2.3 to 2.4, i added following lines in web.xml

[...]


Are you sure that's the *only* thing you changed between the JSP 
compiling OK and getting an error? That seems kinda odd...


L.


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



Re: Another select-option question

2008-03-28 Thread Tom Holmes Jr.

Laurie Harper wrote:

Tom Holmes Jr. wrote:
I've created numerous pages with multiple combo-dropdown boxes that 
captured the label and value of a select box.

The formbean for these was always clear cut and simple.

Now, I have a select like the following:

   A
   B
   C

As I understand it, when I submit, this will submit back a string 
array (String[] test) which is defined in my form bean ... right?


Now lets say I have the following single select

   A
   B
   C


   D
   E
   F

So now there are two with the same name ... I am guessing that I will 
still get back a string array (String[] test) which is defined in my 
form bean ... right?


What I'd really like is a little different.  I'd like the first 
selection test to be test[0] = A,B, or C (since it is single select) AND
I'd like the second selection test to be test[1] = D,E, or F (since 
it is single select)

Or even better yet:
I'd like the first selection test to be test["first_letter"] = A,B, 
or C (since it is single select) AND
I'd like the second selection test to be test["second_letter"] = D,E, 
or F (since it is single select)


So, how would I setup the form bean for this?
The way it is setup now, I have a Collection for test, and it comes 
back with an argument type mismatch.


Any help would be much appreciated, and I will keep working on this.
Thanks!


You're on the right lines; you need a Map rather than a Collection if 
you want key indexing. Your select's name would be test["a"] for the 
first, test["b"] for the second, etc.


L.

Laurie, thanks for thelp, but can you be of more help  I'm been 
working for the last two days, and I am close, but not that close ...
I did have my formBean set with HashMap loaded with data which I think 
is right.


I am going through an iteration loop and that buils my labels which is 
just text ... so label_a, label_b, label_c etc.
Headers contains all my labels that I want on the page. (abel_a, 
label_b, label_c etc.)


My labels are being written out with:  
This works all good.

Within that loop I have an property="mapping"  indexed='
And when I look at the page, I do see  so I am 
not sure if this is truly being indexed the way I want.


So now I have a Collection/ArrayList of LabelValueBeans ... this 
collection is used to populate the drop-down box,
and with:   this works 
great.  And "properties" is a property within the form bean.


The problem again is that for the first select box: label_a: 
mapping["a"] = single selection for combo-box a
and the second select box: label_b: mapping["b"] = single selection for 
combo-box b


if I have explained this correctly, I know I have seen how a single 
select can be created so we populate a combo-box and even get the 
selected for it.
And now I have multiple select boxes indexed with a name (same name as 
the label/header) and I want to get the single "selected." within the 
combo-box.
So, how I define that structure within my form bean is important, then I 
can populate that structure in my pre-action class ...
And then when I submit it ... I don't want to get an 
argument-type-mismatch within the beanutils.populate when I submit the 
JSP page.


Thanks again for the help.   I will keep working on this also.  

 
Tom




-
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: Message surviving redirect

2008-03-28 Thread chubi

Hey guys,

I'm really greatful u made a great deal responding to my problem :handshake:
I am using the message store interceptor, very correctly :confused:... I
also mentioned that the xml tag is not showing correclty in this thread: 
 
  STORE 
 

Plz. read my xml block thouroughly, there is nothing wrong with logic flow,
yet error message are not showing after validation.
Any hint or tip would save my torture :-(
-- 
View this message in context: 
http://www.nabble.com/Message-surviving-redirect-tp16332404p16362268.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Compile error in JSP after upgrading from servlet specification 2.3 to 2.4

2008-03-28 Thread Ashish Kulkarni
Hi
I get compile error in jsp at line


I jsut upgraded web.xml from 2.3 to 2.4, i added following lines in web.xml

http://java.sun.com/xml/ns/j2ee";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";>


Re: [OT] Read XML file from folder outside web application

2008-03-28 Thread Antonio Petrelli
2008/3/28, Ashish Kulkarni <[EMAIL PROTECTED]>:
> Hi
>  i did File f = new File(mypath); and it works
>  What is the danger of doing so?

Sorry, I was a bit misleading. I meant that it is better not to expose
that file with an absolute path to the internet, as it can become a
backdoor to your server.
But, as long as you parse it internally in your code, I think there is
no danger.

Antonio

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



Re: [OT] Read XML file from folder outside web application

2008-03-28 Thread Ashish Kulkarni
Hi
i did File f = new File(mypath); and it works
What is the danger of doing so?

Ashish

On 3/28/08, Antonio Petrelli <[EMAIL PROTECTED]> wrote:
>
> 2008/3/28, Ashish Kulkarni <[EMAIL PROTECTED]>:
>
> >  I can use servletContext.getResource('/WEB-INF/myconfig.xml'); to read
> >  myconfig.xml file which is under WEB-INF from a servlet
> >  If i keep this file at c:/test/myconfig.xml file, can i read it from
> >  a servlet, if so how??
>
>
> You can read it with a File object, giving the absolute path, but in a
> web application is very, very... very very very dangerous!
>
> Antonio
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: [OT] Read XML file from folder outside web application

2008-03-28 Thread Antonio Petrelli
2008/3/28, Ashish Kulkarni <[EMAIL PROTECTED]>:
>  I can use servletContext.getResource('/WEB-INF/myconfig.xml'); to read
>  myconfig.xml file which is under WEB-INF from a servlet
>  If i keep this file at c:/test/myconfig.xml file, can i read it from
>  a servlet, if so how??

You can read it with a File object, giving the absolute path, but in a
web application is very, very... very very very dangerous!

Antonio

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



Re: [OT] Read XML file from folder outside web application

2008-03-28 Thread Martin Gainty
place the myconfig.xml in WEB-INF/classes 
then in struts.xml include that file


M-
- Original Message - 
From: "Ashish Kulkarni" <[EMAIL PROTECTED]>
To: 
Sent: Friday, March 28, 2008 3:22 PM
Subject: [OT] Read XML file from folder outside web application


> Hi
> I can use servletContext.getResource('/WEB-INF/myconfig.xml'); to read
> myconfig.xml file which is under WEB-INF from a servlet
> If i keep this file at c:/test/myconfig.xml file, can i read it from
> a servlet, if so how??
> 
> Ashish
> 

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



[OT] Read XML file from folder outside web application

2008-03-28 Thread Ashish Kulkarni
Hi
I can use servletContext.getResource('/WEB-INF/myconfig.xml'); to read
myconfig.xml file which is under WEB-INF from a servlet
If i keep this file at c:/test/myconfig.xml file, can i read it from
a servlet, if so how??

Ashish


s2: Including Freemarker templates from JSP

2008-03-28 Thread hernan gonzalez
I have some freemarker templates (general purpose, i.e. not
specifically for struts2) that generate html fragments, which I would
like to include in some jsp pages (in a struts2 environment).

Which are my alternatives? At first I tought of making a general jsp

  
   
  

where includeFreemarkerS2.jsp invokes (with Java scriptlet) my already
working aplication logic that finds-parses-fills the template, getting
the datamodel from the corresponding scope. But I am not sure of how
to pass some datamodel that wraps the ValueStack to Freemarker. And I
suspect there must be a simpler and nicer solution.
Suggestions?

HernĂ¡n

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



Re: Calling Action on form load

2008-03-28 Thread aum strut
Jane your solutions is working fine...
was doing a small mistake from my end..

thanks for helping me out..

-aum


On 3/28/08, aum strut <[EMAIL PROTECTED]> wrote:
>
> Hi Jane,
>
> what i m doing in my action class i am putting the list in the session
> like this
>
> Map> session = ActionContext.*getContext*
> ().getSession();
>
> session.put(
> "value",itemCode);
> and in my jsp page i m trying to retrieving the values like this:
>
> <
> s:select label="Select Code" cssClass="large" list="%{#session.value}"
>
> name="code"
>
> headerKey="1"
>
> headerValue="-- Select Item Codet --"
>
> list="ItemCode"
>
> />
> but when ever i m hitting the submitt button it is giving me the exception
>
> tag 'select', field 'list', name 'code': The requested list key 'ItemCode'
> could not be resolved as a collection/array/map/enumeration/iterator type.
> Example: people or people.{name} - [unknown location]
> any suggestion in this regard??
> -aum
>
>
>  On 3/27/08, Jiang, Jane (NIH/NCI) [C] <[EMAIL PROTECTED]> wrote:
> >
> > Aum,
> >
> > After you retrieve the list in your action, save it in session using
> >
> > session.put("mySelectionList", list);
> >
> > Then in your jsp, use the list in session for s:selection.
> >
> >>  list="%{#session.mySelectionList}" listKey="value"
> >  listValue="label" />
> >
> > Hope this helps,
> >
> > Jane
> >
> > -Original Message-
> > From: aum strut [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, March 27, 2008 1:08 PM
> > To: Struts Users Mailing List
> > Subject: Re: Calling Action on form load
> >
> > Jane,
> >
> > can you just give me a brief aidea about (or even if u can a demo code )
> > how
> > u put ur list in to the action.
> >
> > that will be of gr8 help
> >
> > --aum
> >
> >
> > On 3/27/08, Randy Burgess <[EMAIL PROTECTED]> wrote:
> > >
> > > Use the  tag.
> > >
> > > http://struts.apache.org/2.x/docs/action.html
> > >
> > > Regards,
> > > Randy Burgess
> > > Sr. Web Applications Developer
> > > Nuvox Communications
> > >
> > >
> > >
> > > > From: aum strut <[EMAIL PROTECTED]>
> > > > Reply-To: Struts Users Mailing List 
> > > > Date: Thu, 27 Mar 2008 22:04:04 +0530
> > > > To: Struts Users Mailing List 
> > > > Subject: Calling Action on form load
> > > >
> > > > Hi all,
> > > >
> > > > is it possible to call an action in struts2  everytime when the page
> > get
> > > > loaded if yes how it is possible.
> > > > my problem is i am using  tag and using a list to pupulate
> > > this
> > > > drop down this list is coming from the action which i m calling
> > before
> > > the
> > > > page is being displayed.
> > > >
> > > > the folw is like this:
> > > >
> > > > if usercall for this JSP page instaed to direct user directly  to
> > this
> > > page
> > > > i m calling an action which is preaparing a list for the 
> > tag
> > > > and then it is forwarding the user to this page.
> > > >
> > > > Till now eveything is working fine,but when on this page user is
> > > entering
> > > > some values in the fields and hitting the submitting
> > button,exception is
> > > > being thrown which is saying that:
> > > >
> > > >
> > > > select', field 'list', name 'code': The requested list key
> > 'ItemCode'
> > > could
> > > > not be resolved as a collection/array/map/enumeration/iterator type.
> > > > Example: people or people.{name} - [unknown location]
> > > >
> > > > because i thik it is unable to call the action again which is
> > returning
> > > the
> > > > list...is theer any way to call that action each time when user is
> > > > submitting the value..
> > > >
> > > >
> > > >
> > > > any pointer in this regard will be much appriciated.
> > > >
> > > > -aum
> > >
> > >
> > >
> > > This email and any attachments ("Message") may contain legally
> > privileged
> > > and/or confidential information.  If you are not the addressee, or if
> > this
> > > Message has been addressed to you in error, you are not authorized to
> > read,
> > > copy, or distribute it, and we ask that you please delete it
> > (including all
> > > copies) and notify the sender by return email.  Delivery of this
> > Message to
> > > any person other than the intended recipient(s) shall not be deemed a
> > waiver
> > > of confidentiality and/or a privilege.
> > >
> > > -
> > > 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: Calling Action on form load

2008-03-28 Thread aum strut
Hi Jane,

what i m doing in my action class i am putting the list in the session like
this

Map> session = ActionContext.*getContext*
().getSession();

session.put("value",itemCode);
and in my jsp page i m trying to retrieving the values like this:


but when ever i m hitting the submitt button it is giving me the exception

tag 'select', field 'list', name 'code': The requested list key 'ItemCode'
could not be resolved as a collection/array/map/enumeration/iterator type.
Example: people or people.{name} - [unknown location]
any suggestion in this regard??

-aum


On 3/27/08, Jiang, Jane (NIH/NCI) [C] <[EMAIL PROTECTED]> wrote:
>
> Aum,
>
> After you retrieve the list in your action, save it in session using
>
> session.put("mySelectionList", list);
>
> Then in your jsp, use the list in session for s:selection.
>
> list="%{#session.mySelectionList}" listKey="value"
>  listValue="label" />
>
> Hope this helps,
>
> Jane
>
> -Original Message-
> From: aum strut [mailto:[EMAIL PROTECTED]
> Sent: Thursday, March 27, 2008 1:08 PM
> To: Struts Users Mailing List
> Subject: Re: Calling Action on form load
>
> Jane,
>
> can you just give me a brief aidea about (or even if u can a demo code )
> how
> u put ur list in to the action.
>
> that will be of gr8 help
>
> --aum
>
>
> On 3/27/08, Randy Burgess <[EMAIL PROTECTED]> wrote:
> >
> > Use the  tag.
> >
> > http://struts.apache.org/2.x/docs/action.html
> >
> > Regards,
> > Randy Burgess
> > Sr. Web Applications Developer
> > Nuvox Communications
> >
> >
> >
> > > From: aum strut <[EMAIL PROTECTED]>
> > > Reply-To: Struts Users Mailing List 
> > > Date: Thu, 27 Mar 2008 22:04:04 +0530
> > > To: Struts Users Mailing List 
> > > Subject: Calling Action on form load
> > >
> > > Hi all,
> > >
> > > is it possible to call an action in struts2  everytime when the page
> get
> > > loaded if yes how it is possible.
> > > my problem is i am using  tag and using a list to pupulate
> > this
> > > drop down this list is coming from the action which i m calling
> before
> > the
> > > page is being displayed.
> > >
> > > the folw is like this:
> > >
> > > if usercall for this JSP page instaed to direct user directly  to
> this
> > page
> > > i m calling an action which is preaparing a list for the 
> tag
> > > and then it is forwarding the user to this page.
> > >
> > > Till now eveything is working fine,but when on this page user is
> > entering
> > > some values in the fields and hitting the submitting
> button,exception is
> > > being thrown which is saying that:
> > >
> > >
> > > select', field 'list', name 'code': The requested list key
> 'ItemCode'
> > could
> > > not be resolved as a collection/array/map/enumeration/iterator type.
> > > Example: people or people.{name} - [unknown location]
> > >
> > > because i thik it is unable to call the action again which is
> returning
> > the
> > > list...is theer any way to call that action each time when user is
> > > submitting the value..
> > >
> > >
> > >
> > > any pointer in this regard will be much appriciated.
> > >
> > > -aum
> >
> >
> >
> > This email and any attachments ("Message") may contain legally
> privileged
> > and/or confidential information.  If you are not the addressee, or if
> this
> > Message has been addressed to you in error, you are not authorized to
> read,
> > copy, or distribute it, and we ask that you please delete it
> (including all
> > copies) and notify the sender by return email.  Delivery of this
> Message to
> > any person other than the intended recipient(s) shall not be deemed a
> waiver
> > of confidentiality and/or a privilege.
> >
> > -
> > 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]
>
>


dojo is not defined error message in firefox console.

2008-03-28 Thread sharath karnati
Hi All,
   
I'm getting below error message for this 
acrion(http://localhost:7001/hibernate/events/Dojo.action).
   
  dojo is not defined
   dojo.require("dijit.form.Button");
   
Please find my progrm:
 



TooltipDialog demo
  
// Dojo configuration
djConfig = {
 parseOnLoad: true,
baseRelativePath: "<@s.url includeParams='none' value='/struts/dojo' 
includeParams='none' encode='false'/>",
isDebug: true,
bindEncoding: "${parameters.encoding}",
debugAtAllCosts: true // not needed, but allows the Venkman debugger to 
work with the includes
};



  
 
   
  
 dojo.require("dijit.Dialog");
dojo.require("dijit.form.Button");




  
Hello World

console.log('you pressed the button');
alert("You pressed the button.");

   

 
   
In struts.xml, I configured this program as below
   
  
 /pages/test1.jsp

 
  dojoroot directory is in WEB-INF/pages directory. I'm using 
'struts2-core-2.0.11.jar'
 
  Please let me know what is wrong in this code and how to correct this problem.
 
  Thanks in advance.
   
  Regards,
Sharath.

   
-
Looking for last minute shopping deals?  Find them fast with Yahoo! Search.

Re: Retaining request attributes after redirect

2008-03-28 Thread Dave Newton
--- ancatdubher <[EMAIL PROTECTED]> wrote:
> I am building a simple registration module. The user accesses
> /signup.action
> to view signup.jsp. This JSP allows him to enter username, password, phone
> and address. When submitted, the /createUser.action is invoked. Validation
> of form data also happens here. When form data is invalid, I do a redirect:
> 
> 
> signup
> 
> 
> This loses all request attributes.
> I can reclaim the error messages by adding the Message Store interceptor.
> But I would like to be able to display the Signup.jsp back with all fields
> entered by the user. (username, password, phone and address - which are
> members of the USER object member on the createUser action)
> How do I retain these attributes?

One option is to create an "input" result for the createUser action, using
the same JSP as the signup action. 

> 
> [[[Same JSP as signup action]]]
> 

The validation interceptor will go to this result by default, and if
configured as the default dispatcher result type, there won't be a redirect,
meaning nothing is lost. This also avoids action chaining, which isn't really
necessary for a one-step signup process.

Dave


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



Re: Retaining request attributes after redirect

2008-03-28 Thread stanlick
Have you looked at the chain
result type?

On Fri, Mar 28, 2008 at 8:25 AM, ancatdubher <[EMAIL PROTECTED]> wrote:

>
> Hi,
>
> I am building a simple registration module. The user accesses
> /signup.action
> to view signup.jsp. This JSP allows him to enter username, password, phone
> and address. When submitted, the /createUser.action is invoked. Validation
> of form data also happens here. When form data is invalid, I do a
> redirect:
>
> 
>signup
> 
>
> This loses all request attributes.
> I can reclaim the error messages by adding the Message Store interceptor.
> But I would like to be able to display the Signup.jsp back with all fields
> entered by the user. (username, password, phone and address - which are
> members of the USER object member on the createUser action)
> How do I retain these attributes?
>
> -Thanks, Ancat
> --
> View this message in context:
> http://www.nabble.com/Retaining-request-attributes-after-redirect-tp16349672p16349672.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Scott
[EMAIL PROTECTED]


Retaining request attributes after redirect

2008-03-28 Thread ancatdubher

Hi,

I am building a simple registration module. The user accesses /signup.action
to view signup.jsp. This JSP allows him to enter username, password, phone
and address. When submitted, the /createUser.action is invoked. Validation
of form data also happens here. When form data is invalid, I do a redirect:


signup


This loses all request attributes.
I can reclaim the error messages by adding the Message Store interceptor.
But I would like to be able to display the Signup.jsp back with all fields
entered by the user. (username, password, phone and address - which are
members of the USER object member on the createUser action)
How do I retain these attributes?

-Thanks, Ancat
-- 
View this message in context: 
http://www.nabble.com/Retaining-request-attributes-after-redirect-tp16349672p16349672.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Struts 2 vs. Stripes

2008-03-28 Thread Asleson, Ryan
 
Hello,
 
My company is considering replacements for Struts 1.x.  The finalists
are Struts 2 and Stripes.  Not trying to start a flame war here, but can
anybody comment on the relative strengths and weaknesses of Struts 2 vs.
Stripes?
 
Thank you!!
 
 

This e-mail message is being sent solely for use by the intended recipient(s) 
and may contain confidential information.  Any unauthorized review, use, 
disclosure or distribution is prohibited.  If you are not the intended 
recipient, please contact the sender by phone or reply by e-mail, delete the 
original message and destroy all copies. Thank you.

Action Problem ....

2008-03-28 Thread Narayana S
Hi,

   i am having one link in a page. when i click on the link, i am
going to the other page with some request level attribute. in the second
page i have one update button, when i press that button, after performing
some action and should return back to the 1st page along with same request
attribute. this is my scenario..

if i am using redirect action, it is not passing request parameters. how to
solve this problem?


Re: S2/Sitemesh: How to set the title in a freemarker template?

2008-03-28 Thread me
May be. I haven't done anything with struts 2 and sitemesh until now. 
Mostly I had worked with struts 1 but

I had to upgrade now (So I'm still a beginner. :) )

[EMAIL PROTECTED] schrieb:

Dude, do you sleep?

On Fri, Mar 28, 2008 at 5:09 AM, me <[EMAIL PROTECTED]> wrote:

  



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



Re: S2/Sitemesh: How to set the title in a freemarker template?

2008-03-28 Thread stanlick
Dude, do you sleep?

On Fri, Mar 28, 2008 at 5:09 AM, me <[EMAIL PROTECTED]> wrote:

> Great! It works perfectly!
>
> Thank you very much!!!
>
> Marc
>
> [EMAIL PROTECTED] schrieb:
> > Try stack.findString('title') instead of ${title}
> >
> > On Fri, Mar 28, 2008 at 4:57 AM, me <[EMAIL PROTECTED]> wrote:
> >
> >
> >> [EMAIL PROTECTED] schrieb:
> >>
> >>> No problem bro
> >>>
> >>> Let's see what you added to your template to fetch the title from
> action
> >>>
> >> Okay, these are my files:
> >>
> >> template.ftl:
> >> --
> >>  >> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
> >> 
> >> 
> >>test - ${title}
> >> 
> >> 
> >> ${body}
> >> 
> >> 
> >> --
> >>
> >> ContactAction:
> >> --
> >> package isi.services.pages;
> >>
> >> import com.opensymphony.xwork2.ActionSupport;
> >>
> >>
> >> public class ContactAction extends ActionSupport {
> >>
> >>  String title = "hallo";
> >>
> >>  public String execute() {
> >>return "input";
> >>  }
> >>
> >>  public String getTitle() {
> >>return this.title;
> >>  }
> >>
> >>  public void setTitle(final String value) {
> >>this.title = value;
> >>  }
> >>
> >> }
> >> --
> >>
> >>
> >> -
> >> 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]
>
>


-- 
Scott
[EMAIL PROTECTED]


Re: S2/Sitemesh: How to set the title in a freemarker template?

2008-03-28 Thread me

Great! It works perfectly!

Thank you very much!!!

Marc

[EMAIL PROTECTED] schrieb:

Try stack.findString('title') instead of ${title}

On Fri, Mar 28, 2008 at 4:57 AM, me <[EMAIL PROTECTED]> wrote:

  

[EMAIL PROTECTED] schrieb:


No problem bro

Let's see what you added to your template to fetch the title from action
  

Okay, these are my files:

template.ftl:
--
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>


   test - ${title}


${body}


--

ContactAction:
--
package isi.services.pages;

import com.opensymphony.xwork2.ActionSupport;


public class ContactAction extends ActionSupport {

 String title = "hallo";

 public String execute() {
   return "input";
 }

 public String getTitle() {
   return this.title;
 }

 public void setTitle(final String value) {
   this.title = value;
 }

}
--


-
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: S2/Sitemesh: How to set the title in a freemarker template?

2008-03-28 Thread stanlick
Try stack.findString('title') instead of ${title}

On Fri, Mar 28, 2008 at 4:57 AM, me <[EMAIL PROTECTED]> wrote:

>
> [EMAIL PROTECTED] schrieb:
> > No problem bro
> >
> > Let's see what you added to your template to fetch the title from action
> Okay, these are my files:
>
> template.ftl:
> --
>  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
> 
> 
>test - ${title}
> 
> 
> ${body}
> 
> 
> --
>
> ContactAction:
> --
> package isi.services.pages;
>
> import com.opensymphony.xwork2.ActionSupport;
>
>
> public class ContactAction extends ActionSupport {
>
>  String title = "hallo";
>
>  public String execute() {
>return "input";
>  }
>
>  public String getTitle() {
>return this.title;
>  }
>
>  public void setTitle(final String value) {
>this.title = value;
>  }
>
> }
> --
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Scott
[EMAIL PROTECTED]


Re: S2/Sitemesh: How to set the title in a freemarker template?

2008-03-28 Thread me


[EMAIL PROTECTED] schrieb:

No problem bro

Let's see what you added to your template to fetch the title from action

Okay, these are my files:

template.ftl:
--
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>



   test - ${title}


${body}


--

ContactAction:
--
package isi.services.pages;

import com.opensymphony.xwork2.ActionSupport;


public class ContactAction extends ActionSupport {

 String title = "hallo";

 public String execute() {
   return "input";
 }

 public String getTitle() {
   return this.title;
 }

 public void setTitle(final String value) {
   this.title = value;
 }

}
--


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



Re: S2/Sitemesh: How to set the title in a freemarker template?

2008-03-28 Thread stanlick
No problem bro

Let's see what you added to your template to fetch the title from action

On Fri, Mar 28, 2008 at 4:18 AM, me <[EMAIL PROTECTED]> wrote:

> Sorry but I think I miss something. I've got a action which extends
> ActionSupport. This Action has got an execute() method
> and an title property with the getters and setters.
> The action is properly read and executed. But the property wasn't. Is
> there anything I have to take care of?
> Sorry for my stupid questions.
>
> Marc
>
> [EMAIL PROTECTED] schrieb:
> > The FreeMarker template can access the property in your action to get
> the
> > "action variable" title.
> >
> > On Fri, Mar 28, 2008 at 3:24 AM, me <[EMAIL PROTECTED]> wrote:
> >
> >
> >> Hi,
> >>
> >> hmmm... do you mean that I should create a template for each site which
> >> has another title?
> >> I think that would be too much. I've got several pages which should get
> >> a title based on information
> >> located in a database.
> >>
> >> I thought that there will be a property in the action i have to set or
> >> can I access the
> >> value-stack from the sitemesh-freemarker template?
> >>
> >>
> >> Marc
> >>
> >> [EMAIL PROTECTED] schrieb:
> >>
> >>> Hey Marc --
> >>>
> >>> copy that FreeMarker template into your /template folder and
> >>>
> >> modify
> >>
> >>> it with your desired changes.  Struts 2 will grab yours for rendering.
> >>>
> >>>
> >>> On Fri, Mar 28, 2008 at 2:14 AM, me <[EMAIL PROTECTED]> wrote:
> >>>
> >>>
> >>>
>  Hi,
> 
>  I'm running struts2 with sitemesh. There is a freemarker template
>  defined in the decorators and this template
>  has both variables $title and $body. The body is filled autmatically
>  which is okay. But I want to set the title
>  from the action I've called because I wanted to have the content and
> 
> >> the
> >>
>  title having a relation to each other
>  (which makes sense, I believe... :) )
> 
>  Thanks for your help.
> 
>  Marc
> 
>  -
>  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]
>
>


-- 
Scott
[EMAIL PROTECTED]


Re: S2/Sitemesh: How to set the title in a freemarker template?

2008-03-28 Thread me
Sorry but I think I miss something. I've got a action which extends 
ActionSupport. This Action has got an execute() method

and an title property with the getters and setters.
The action is properly read and executed. But the property wasn't. Is 
there anything I have to take care of?

Sorry for my stupid questions.

Marc

[EMAIL PROTECTED] schrieb:

The FreeMarker template can access the property in your action to get the
"action variable" title.

On Fri, Mar 28, 2008 at 3:24 AM, me <[EMAIL PROTECTED]> wrote:

  

Hi,

hmmm... do you mean that I should create a template for each site which
has another title?
I think that would be too much. I've got several pages which should get
a title based on information
located in a database.

I thought that there will be a property in the action i have to set or
can I access the
value-stack from the sitemesh-freemarker template?


Marc

[EMAIL PROTECTED] schrieb:


Hey Marc --

copy that FreeMarker template into your /template folder and
  

modify


it with your desired changes.  Struts 2 will grab yours for rendering.


On Fri, Mar 28, 2008 at 2:14 AM, me <[EMAIL PROTECTED]> wrote:


  

Hi,

I'm running struts2 with sitemesh. There is a freemarker template
defined in the decorators and this template
has both variables $title and $body. The body is filled autmatically
which is okay. But I want to set the title
from the action I've called because I wanted to have the content and


the


title having a relation to each other
(which makes sense, I believe... :) )

Thanks for your help.

Marc

-
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: S2/Sitemesh: How to set the title in a freemarker template?

2008-03-28 Thread stanlick
The FreeMarker template can access the property in your action to get the
"action variable" title.

On Fri, Mar 28, 2008 at 3:24 AM, me <[EMAIL PROTECTED]> wrote:

> Hi,
>
> hmmm... do you mean that I should create a template for each site which
> has another title?
> I think that would be too much. I've got several pages which should get
> a title based on information
> located in a database.
>
> I thought that there will be a property in the action i have to set or
> can I access the
> value-stack from the sitemesh-freemarker template?
>
>
> Marc
>
> [EMAIL PROTECTED] schrieb:
> > Hey Marc --
> >
> > copy that FreeMarker template into your /template folder and
> modify
> > it with your desired changes.  Struts 2 will grab yours for rendering.
> >
> >
> > On Fri, Mar 28, 2008 at 2:14 AM, me <[EMAIL PROTECTED]> wrote:
> >
> >
> >> Hi,
> >>
> >> I'm running struts2 with sitemesh. There is a freemarker template
> >> defined in the decorators and this template
> >> has both variables $title and $body. The body is filled autmatically
> >> which is okay. But I want to set the title
> >> from the action I've called because I wanted to have the content and
> the
> >> title having a relation to each other
> >> (which makes sense, I believe... :) )
> >>
> >> Thanks for your help.
> >>
> >> Marc
> >>
> >> -
> >> 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]
>
>


-- 
Scott
[EMAIL PROTECTED]


Re: Message surviving redirect

2008-03-28 Thread stanlick
Sorry about that!  My config specified the interceptor as:


  STORE


Also, I think you can specify store/retrieve as a request parameter as an
alternative to the XML

On Fri, Mar 28, 2008 at 12:30 AM, Laurie Harper <[EMAIL PROTECTED]> wrote:

> He *is* using the store interceptor :-), though apparently it's not
> working. I haven't used it myself but perhaps you can see what's wrong
> in the configuration he posted?
>
> L.
>
> [EMAIL PROTECTED] wrote:
> > Since "chain" can be a bad design practice, you might want to look at
> the store
> >  >interceptor.
> > I have used it successfully.
> >
> > On Thu, Mar 27, 2008 at 4:02 PM, Jiang, Jane (NIH/NCI) [C] <
> > [EMAIL PROTECTED]> wrote:
> >
> >> Instead of type="redirect-action", did you try "chain"?
> >>
> >> -Original Message-
> >> From: chubi [mailto:[EMAIL PROTECTED]
> >> Sent: Thursday, March 27, 2008 4:05 PM
> >> To: user@struts.apache.org
> >> Subject: Message surviving redirect
> >>
> >>
> >> Hello,
> >> I have posted the same problem in a previous thread, yet got no
> >> reply,
> >> but I'm really stuck with it and spending days trying to solve it, in
> >> vain... 
> >>
> >> I have two actions: editFeature and saveFeature. Whereas editFeature
> >> should
> >> submit successfuly to saveFeature the latter performs and redirects
> >> transparently to editFeature again. This is ok using redirect-action.
> >>
> >> But in case when validation fails after submission, I get back to
> >> editFeature with all error messages lost.
> >> I read a previous thread talkin about the same problem and giving a
> >> satisfying solution with the store interceptor, though I could not come
> >> to
> >> solve my problem.
> >> Here is my struts actions:
> >> pst: the store interceptor tags do not show correctly in this thread.
> >>
> >>   >> class="com.intelligile.lms.webapp.action.FeatureAction" method="edit">
> >>
> >>
> >>RETRIEVE
> >>
> >>/WEB-INF/pages/featureForm.jsp
> >>/WEB-INF/pages/featureList.jsp
> >>
> >>
> >>
> >> >> class="com.intelligile.lms.webapp.action.FeatureAction" method="save">
> >>
> >>
> >>STORE
> >>
> >> >> type="redirect">features.html
> >>
> >>editFeature.html
> >>true
> >>${feature.dkey}
> >>
> >>
> >>
> >> Please help me figure out where the problem exists.
> >> Thank you for your support.
> >> Best regards.
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/Message-surviving-redirect-tp16332404p16332404.htm
> >> l
> >> Sent from the Struts - User mailing list archive at Nabble.com.
> >>
> >>
> >> -
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >> -
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >
> >
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Scott
[EMAIL PROTECTED]


Re: S2/Sitemesh: How to set the title in a freemarker template?

2008-03-28 Thread me

Hi,

hmmm... do you mean that I should create a template for each site which 
has another title?
I think that would be too much. I've got several pages which should get 
a title based on information

located in a database.

I thought that there will be a property in the action i have to set or 
can I access the

value-stack from the sitemesh-freemarker template?


Marc

[EMAIL PROTECTED] schrieb:

Hey Marc --

copy that FreeMarker template into your /template folder and modify
it with your desired changes.  Struts 2 will grab yours for rendering.


On Fri, Mar 28, 2008 at 2:14 AM, me <[EMAIL PROTECTED]> wrote:

  

Hi,

I'm running struts2 with sitemesh. There is a freemarker template
defined in the decorators and this template
has both variables $title and $body. The body is filled autmatically
which is okay. But I want to set the title
from the action I've called because I wanted to have the content and the
title having a relation to each other
(which makes sense, I believe... :) )

Thanks for your help.

Marc

-
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: S2/Sitemesh: How to set the title in a freemarker template?

2008-03-28 Thread stanlick
Hey Marc --

copy that FreeMarker template into your /template folder and modify
it with your desired changes.  Struts 2 will grab yours for rendering.


On Fri, Mar 28, 2008 at 2:14 AM, me <[EMAIL PROTECTED]> wrote:

> Hi,
>
> I'm running struts2 with sitemesh. There is a freemarker template
> defined in the decorators and this template
> has both variables $title and $body. The body is filled autmatically
> which is okay. But I want to set the title
> from the action I've called because I wanted to have the content and the
> title having a relation to each other
> (which makes sense, I believe... :) )
>
> Thanks for your help.
>
> Marc
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Scott
[EMAIL PROTECTED]


Re: Please answer this struts basic qtn

2008-03-28 Thread Al Sutton

Here is clear cut answer; "READ THE TUTORIALS".

We're not going to do you homework for you, and we're certainly not going to 
help you pass an interview which is designed to look for peoplewho have 
worked on struts much.


Al.

- Original Message - 
From: "pannar" <[EMAIL PROTECTED]>

To: 
Sent: Friday, March 28, 2008 5:55 AM
Subject: Re: Please answer this struts basic qtn




If u know the answer, please share with us.. I haven't worked on struts
much..

We have to override execute method to forward from one page to another 
page

by using mapping.findForward("testAction") some thing like that..
DB/business logic should be inside of execute () method? is there any 
other

way to invoke methods without using execute()..
i dont know , thats the reason i am asking you people to clarify this ok..

Awaiting for your clear cut answer and thanak you for ur kindness

--
View this message in context: 
http://www.nabble.com/Please-answer-this-struts-basic-qtn-tp16324821p16346313.html

Sent from the Struts - User mailing list archive at Nabble.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]



S2/Sitemesh: How to set the title in a freemarker template?

2008-03-28 Thread me

Hi,

I'm running struts2 with sitemesh. There is a freemarker template 
defined in the decorators and this template
has both variables $title and $body. The body is filled autmatically 
which is okay. But I want to set the title
from the action I've called because I wanted to have the content and the 
title having a relation to each other

(which makes sense, I believe... :) )

Thanks for your help.

Marc

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