Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

user Digest 30 Mar 2008 13:40:45 -0000 Issue 7950

user-digest-help

2008-03-30


Author LoginPost Reply

user Digest 30 Mar 2008 13:40:45 -0000 Issue 7950

Topics (messages 184774 through 184803):

Re: Calling Action on form load
 184774 by: aum strut

Re: Including Freemarker templates from JSP
 184775 by: hernan gonzalez

[OT] Read XML file from folder outside web application
 184776 by: Ashish Kulkarni
 184777 by: Martin Gainty
 184778 by: Antonio Petrelli
 184779 by: Ashish Kulkarni
 184780 by: Antonio Petrelli

Compile error in JSP after upgrading from servlet specification 2.3 to 2.4
 184781 by: Ashish Kulkarni
 184784 by: Laurie Harper

Re: Message surviving redirect
 184782 by: chubi

Re: Another select-option question
 184783 by: Tom Holmes Jr.

Client Side Validation with Struts
 184785 by: Asad Habib
 184788 by: Lukasz Lenart
 184795 by: Asad Habib

how to refresh only included pages
 184786 by: roshana
 184787 by: roshana

struts- validation messages
 184789 by: Sonu S
 184790 by: Nuwan Chandrasoma

Validation
 184791 by: Rodrigo Pereira
 184792 by: Nuwan Chandrasoma

Annotations for additional properties for type converters?
 184793 by: Karr, David

Possible to unit test actions through type converters?
 184794 by: Karr, David

Initializing Actions from Spring
 184796 by: georgievh
 184802 by: mgainty.hotmail.com

how to confirm eclipse wtp contain struts 2.x?
 184797 by: Tan CyberT.n
 184800 by: stanlick.gmail.com
 184801 by: Tan CyberT.n
 184803 by: Piero Sartini

Re: dojo is not defined error message in firefox console.
 184798 by: Jeromy Evans

Eroor Message display
 184799 by: aum strut

Administrivia:

---------------------------------------------------------------------
To post to the list, e-mail: user@(protected)
To unsubscribe, e-mail: user-digest-unsubscribe@(protected)
For additional commands, e-mail: user-digest-help@(protected)

----------------------------------------------------------------------

Attachment: user_184774.ezm (zipped)
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 <aum.struts@(protected):
>
> Hi Jane,
>
> what i m doing in my action class i am putting the list in the session
> like this
>
> Map<String, ArrayList<String>> 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] <jiangja@(protected):
> >
> > 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.
> >
> >  <s:select name="mysSelection" cssClass="large" value="selectedValue"
> >         list="%{#session.mySelectionList}" listKey="value"
> >         listValue="label" />
> >
> > Hope this helps,
> >
> > Jane
> >
> > -----Original Message-----
> > From: aum strut [mailto:aum.struts@(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 <RBurgess@(protected):
> > >
> > > Use the <s:action> tag.
> > >
> > > http://struts.apache.org/2.x/docs/action.html
> > >
> > > Regards,
> > > Randy Burgess
> > > Sr. Web Applications Developer
> > > Nuvox Communications
> > >
> > >
> > >
> > > > From: aum strut <aum.struts@(protected)>
> > > > Reply-To: Struts Users Mailing List <user@(protected)>
> > > > Date: Thu, 27 Mar 2008 22:04:04 +0530
> > > > To: Struts Users Mailing List <user@(protected)>
> > > > 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 <s:select> 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 <s:select>
> > 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: user-unsubscribe@(protected)
> > > For additional commands, e-mail: user-help@(protected)
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > For additional commands, e-mail: user-help@(protected)
> >
> >
>

Attachment: user_184775.ezm (zipped)
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

<jsp:include page="includeFreemarkerS2.jsp">
    <jsp:param name="templateName" value="test/foo.ftl" />
</jsp:include>

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

Attachment: user_184776.ezm (zipped)
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

Attachment: user_184777.ezm (zipped)
place the myconfig.xml in WEB-INF/classes
then in struts.xml include that file
  <include file="myconfig.xml"/>

M-
----- Original Message -----
From: "Ashish Kulkarni" <ashish.kulkarni13@(protected)>
To: <user@(protected)>
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
>

Attachment: user_184778.ezm (zipped)
2008/3/28, Ashish Kulkarni <ashish.kulkarni13@(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

Attachment: user_184779.ezm (zipped)
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 <antonio.petrelli@(protected):
>
> 2008/3/28, Ashish Kulkarni <ashish.kulkarni13@(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: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment: user_184780.ezm (zipped)
2008/3/28, Ashish Kulkarni <ashish.kulkarni13@(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

Attachment: user_184781.ezm (zipped)
Hi
I get compile error in jsp at line
<c:if test="${loginForm.map.singlesignon == '1'}">

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

<web-app version="2.4"
xmlns="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">

Attachment: user_184784.ezm (zipped)
Ashish Kulkarni wrote:
> Hi
> I get compile error in jsp at line
> <c:if test="${loginForm.map.singlesignon == '1'}">

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.


Attachment: user_184782.ezm (zipped)

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:
<interceptor-ref name="store">
STORE
</interceptor-ref>

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


Attachment: user_184783.ezm (zipped)
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:
>> <select name="test" multiple="true">
>>   <option value="selection a">A</option>
>>   <option value="selection b">B</option>
>>   <option value="selection c">C</option>
>> </select>
>> 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
>> <select name="test">
>>   <option value="selection a">A</option>
>>   <option value="selection b">B</option>
>>   <option value="selection c">C</option>
>> </select>
>> <select name="test">
>>   <option value="selection d">D</option>
>>   <option value="selection e">E</option>
>>   <option value="selection f">F</option>
>> </select>
>> 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.)
<logic:iterate id="header" name="myFormBean" property="headers">
My labels are being written out with: <bean:write name="header">
This works all good.

Within that loop I have an <html:select name="myFormBean"
property="mapping" indexed='<bean:write name="header'>">
And when I look at the page, I do see <select name="mapping"> 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:  <html:optionsCollection name="properties" />   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: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>


Attachment: user_184785.ezm (zipped)
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

Attachment: user_184788.ezm (zipped)
Hi,

Could you be more specific, which Struts version? If you use onsubmit
event, you should do that like this:

onsubmit="JavaScript: return validate();"

where validate() has to return true or false.


Regards
--
Lukasz

http://www.linkedin.com/in/lukaszlenart

Attachment: user_184795.ezm (zipped)
Hello. I am using Struts 1.3.8. The issue is not one of making the
Javascript work (it is working correctly), but rather preventing a
Struts action from being called. Is this possible given that the
action of a form is a Struts action?

- Asad



On Sat, Mar 29, 2008 at 6:44 AM, Lukasz Lenart
<lukasz.lenart@(protected):
> Hi,
>
> Could you be more specific, which Struts version? If you use onsubmit
> event, you should do that like this:
>
> onsubmit="JavaScript: return validate();"
>
> where validate() has to return true or false.
>
>
> Regards
> --
> Lukasz
>
> http://www.linkedin.com/in/lukaszlenart
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment: user_184786.ezm (zipped)

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 <div> tag is used to control the display of both jsps. once the import
button is clicked, the second jsp is shown by
<div id="show"..>
<jsp:include page="second.jsp">
</div>
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.
--
Sent from the Struts - User mailing list archive at Nabble.com.


Attachment: user_184787.ezm (zipped)

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 <div> tag is used to control the display of both jsps. once the import
button is clicked, the second jsp is shown by
<div id="show"..>
<jsp:include page="second.jsp">
</div>
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 though a similar code in the forum post by Mr.stevejluke
http://forum.java.sun.com/thread.jspa?threadID=554223&forumID=45.. I was
following this logic..

Please help me....

thanks.
roshana.
--
Sent from the Struts - User mailing list archive at Nabble.com.


Attachment: user_184789.ezm (zipped)
Hi,

I am using struts in my application. to validate users entry in jsp i have
my validation method. and i am calling that method in action class. code is
below:(I am not using struts' validations )

// in action class, calling validate method
ActionErrors errors = myForm.validate(mapping,request);


//In form bean
public ActionErrors validate(ActionMapping mapping, HttpServletRequest
request) {
    ActionErrors errors = new ActionErrors();
    if(("".equals(name.trim()))){
       errors.add(name, new ActionError("myForm.Name"));
    }
    if(("".equals(address.trim()))){
       errors.add(address, new ActionError("myForm.address"));
    }
    return errors;
  }



// in action class checking is errors are empty
if (!errors.isEmpty()) {
  saveErrors(request, errors);
  return mapping.findForward("ADD");
}


above code is working fine. Only problem is it is printing error messages in
jsp in one line.

example: Enter Name. Enter Address.


I would like to show every error message on new line in jsp. is it possible.


in jsp i am using <html:errors/> to print message.


thank you for your time and solutions

Attachment: user_184790.ezm (zipped)
http://www.niallp.pwp.blueyonder.co.uk/HelpTagsErrorsAndMessages.html

Thanks,

Nuwan


Sonu S wrote:
> Hi,
>
> I am using struts in my application. to validate users entry in jsp i have
> my validation method. and i am calling that method in action class. code is
> below:(I am not using struts' validations )
>
> // in action class, calling validate method
> ActionErrors errors = myForm.validate(mapping,request);
>
>
> //In form bean
> public ActionErrors validate(ActionMapping mapping, HttpServletRequest
> request) {
>      ActionErrors errors = new ActionErrors();
>      if(("".equals(name.trim()))){
>         errors.add(name, new ActionError("myForm.Name"));
>      }
>      if(("".equals(address.trim()))){
>         errors.add(address, new ActionError("myForm.address"));
>      }
>      return errors;
>   }
>
>
>
> // in action class checking is errors are empty
> if (!errors.isEmpty()) {
>   saveErrors(request, errors);
>   return mapping.findForward("ADD");
> }
>
>
> above code is working fine. Only problem is it is printing error messages in
> jsp in one line.
>
> example: Enter Name. Enter Address.
>
>
> I would like to show every error message on new line in jsp. is it possible.
>
>
> in jsp i am using <html:errors/> to print message.
>
>
> thank you for your time and solutions
>
>  


Attachment: user_184791.ezm (zipped)
Hi,
how can I position validation message on the screen? Also, when I have
a simple theme form I am getting JS error alert message "[object
Error]", does anybody know how to fix that?

form:

<s:form id="testForm" action="save" method="post" validate="true">
 <table>      
   <tr>
     <td align="right"><s:text name="label.email"/><span
class="required">*</span>:</td>
     <td><s:textfield name="user.email" value="%{user.email}" size="30"
theme="simple"/></td>
   </tr>
 </table>
</s:form>

validation.xml:

<validators>

<field name="user.email">  

 <field-validator type="required">
      <message key="errors.email.required"/>
  </field-validator>

 <field-validator type="email">
   <message key="errors.email.notValid" />
 </field-validator>

</field>

</validators>

Thanks,
Rodrigo Pereira

Attachment: user_184792.ezm (zipped)
Hi,

Simple theme doesn't support Validation and error reporting. you may
have to use some other theme like xhtml theme

http://struts.apache.org/2.x/docs/xhtml-theme.html

Thanks,

Nuwan

Rodrigo Pereira wrote:
> Hi,
> how can I position validation message on the screen? Also, when I have
> a simple theme form I am getting JS error alert message "[object
> Error]", does anybody know how to fix that?
>
> form:
>
> <s:form id="testForm" action="save" method="post" validate="true">
>  <table>      
>    <tr>
>      <td align="right"><s:text name="label.email"/><span
> class="required">*</span>:</td>
>      <td><s:textfield name="user.email" value="%{user.email}" size="30"
> theme="simple"/></td>
>    </tr>
>  </table>
> </s:form>
>
> validation.xml:
>
> <validators>
>
>  <field name="user.email">  
>
>    <field-validator type="required">
>       <message key="errors.email.required"/>
>   </field-validator>
>
>  <field-validator type="email">
>    <message key="errors.email.notValid" />
>  </field-validator>
>
>  </field>
>
> </validators>
>
> Thanks,
> Rodrigo Pereira
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>  


Attachment: user_184793.ezm (zipped)
I don't necessarily need this, but is it possible to add annotations to
"TypeConversion" to configure properties of the type converter? It's
nice to be able to define type converters in annotations, but you could
achieve some more reuse of type converters if they were more
configurable from the point of reference. For instance (like in
PAS2W2P's example) if you have a converter for a specific date format,
you could make the converter more generic, and specify the date format
in the annotation. I suppose I might also considering injecting the
format through spring from a properties file also.

Attachment: user_184794.ezm (zipped)
This might be a violation of pure "unit test" guidelines, but is it
practical to test an action such that the type converters for properties
are automatically executed, just like they would normally? It's nice
that actions are plain POJOs, but I wonder if it's practical to test the
processing of property values into the type converters.

Attachment: user_184796.ezm (zipped)


Hi,

I am trying to initialize Struts2 Actions from Spring.
I have done this successfully using struts2 xml configuration files.
However, I did not have the same success when using annotations.

Could anyone please explain how I can achieve this.

Here is my approach:
In file MainpageAction.java I have:
...
@Result( name="success", value="mainpage.page", type=TilesResult.class )
...

In applicationContext.xml I have:

   <bean id="mainpageAction"
     class="com.gbsoft.belfin.communitypages.actions.mainpage.MainpageAction"
     autowire="autodetect"
     singleton="false">
   <constructor-arg>
     <value>Buenos Dias!</value>
   </constructor-arg>
 </bean>


Thank you in advance for your help
--
Sent from the Struts - User mailing list archive at Nabble.com.


Attachment: user_184802.ezm (zipped)
pls display contents of your xwork.xml
and the configuration of the spring listener you are referencing in web.xml

http://www.opensymphony.com/webwork/wikidocs/Other%20Spring%20Integration.ht
ml

Thanks
Martin-
----- Original Message -----
Wrom: TLBXFGGMEPYOQKEDOTWFAOBUZXUWLSZLKBR
To: <user@(protected)>
Sent: Saturday, March 29, 2008 9:15 PM
Subject: Initializing Actions from Spring




Hi,

I am trying to initialize Struts2 Actions from Spring.
I have done this successfully using struts2 xml configuration files.
However, I did not have the same success when using annotations.

Could anyone please explain how I can achieve this.

Here is my approach:
In file MainpageAction.java I have:
..
@Result( name="success", value="mainpage.page", type=TilesResult.class )
..

In applicationContext.xml I have:

<bean id="mainpageAction"
class="com.gbsoft.belfin.communitypages.actions.mainpage.MainpageAction"
autowire="autodetect"
singleton="false">
<constructor-arg>
<value>Buenos Dias!</value>
</constructor-arg>
</bean>


Thank you in advance for your help
--
http://www.nabble.com/Initializing-Actions-from-Spring-tp16377674p16377674.h
tml
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)



Attachment: user_184797.ezm (zipped)
I'm a new user in sruts and wtp. may i know is wtp all in one contained
struts 2.x ? if no. how can i import it as a plug-in?

Attachment: user_184800.ezm (zipped)
Hey Tan --

I doubt WTP contains Struts2, but you can get it
here<http://struts.apache.org/2.x/>
.

On Sun, Mar 30, 2008 at 5:54 AM, Tan CyberT@(protected)>
wrote:

> I'm a new user in sruts and wtp. may i know is wtp all in one contained
> struts 2.x ? if no. how can i import it as a plug-in?
>



--
Scott
stanlick@(protected)

Attachment: user_184801.ezm (zipped)
hi stanlick,

yes, I did go to the site. but, i'm not sure on how to make it as a
plugin to deploy in eclipse 3.3.
i did downloaded the war file and import into eclipse 3.3, it 's working
fine. is it every project I just need to copy 5 files to Web App Libraries,
commons-logging-1.0.4.jar
freemarker=2.3.8.jar
ognl-2.6.11.jar
struts2-core-2.0.11.jar
xwork-2.0.4.jar
?

then, consider is struts enabled?

Thank you.

Regards,
Tan



stanlick@(protected):
> Hey Tan --
>
> I doubt WTP contains Struts2, but you can get it
> here<http://struts.apache.org/2.x/>
> .
>
> On Sun, Mar 30, 2008 at 5:54 AM, Tan CyberT@(protected)>
> wrote:
>
>  
>> I'm a new user in sruts and wtp. may i know is wtp all in one contained
>> struts 2.x ? if no. how can i import it as a plug-in?
>>
>>  
>
>
>
>  


Attachment: user_184803.ezm (zipped)
> yes, I did go to the site. but, i'm not sure on how to make it as a
> plugin to deploy in eclipse 3.3.

There is no plugin for Eclipse or any other IDE that I know. There is the
beginning of a NetBeans plugin... but I did not look at it yet.

> i did downloaded the war file and import into eclipse 3.3, it 's working
> fine. is it every project I just need to copy 5 files to Web App Libraries,
> commons-logging-1.0.4.jar
> freemarker=2.3.8.jar
> ognl-2.6.11.jar
> struts2-core-2.0.11.jar
> xwork-2.0.4.jar
> ?

These and any struts2 plugins you want to use. The "Blank" Application is a
good starting point for own applications.

If you do use maven2, there is an easier way:
mvn archetype:create -DgroupId=org.yoursite \
              -DartifactId=appname \
              -DarchetypeGroupId=org.apache.struts \
              -DarchetypeArtifactId=struts2-archetype-starter \
              -DarchetypeVersion=2.0.11 \
              -DremoteRepositories=http://people.apache.org/builds/struts/m2-staging-repository

> then, consider is struts enabled?

The JARs alone do not enable s2. You need the right entrys in web.xml and put
the struts configuration file in place.


 Piero

Attachment: user_184798.ezm (zipped)
Are you deliberately mixing Dojo 0.40 with Dojo 1.x?

The <s:head theme=ajax> tag includes resources for Dojo 0.40. In
addition to that you're referenced a local dojo installation that
includes Digit (1.x)

The "dojo undefined" message implies neither worked so there's a major
error. Use FireBug to confirm that dojo.js is found.

sharath karnati wrote:
> 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:
>    
> <html>
> <head>
> <s:head theme="ajax" debug="true"/>
> <title>TooltipDialog demo</title>
>  <script type="text/javascript">
>   // Dojo configuration
>   djConfig = {
>    parseOnLoad: true,
>      baseRelativePath: "<@(protected)'/>",
>      isDebug: true,
>      bindEncoding: "${parameters.encoding}",
>      debugAtAllCosts: true // not needed, but allows the Venkman debugger to work with the includes    
>   };
> </script>
> <script type="text/javascript"
>      src="<@(protected)'/>">
> </script>
>  
> <link href="<s:url value='/pages/dojoroot/dojo/resources/dojo.css'/>" rel='stylesheet' type='text/css' />
> <link href="<s:url value='/pages/dojoroot/dijit/themes/tundra/tundra.css'/>" rel='stylesheet' type='text/css' />      
>  <script type="text/javascript">
>       dojo.require("dijit.Dialog");
>         dojo.require("dijit.form.Button");
> </script>
>  
> </head>
> <body class="tundra">
>  <button dojoType="dijit.form.Button" id="helloButton">
>                 Hello World
>                 <script type="dojo/method" event="onClick">
>                      console.log('you pressed the button');
>                      alert("You pressed the button.");
>                 </script>
>   </button>
> </body>
> </html>
>  
>   In struts.xml, I configured this program as below
>  
>     <action name="Dojo">
> <result>/pages/test1.jsp</result>
>   </action>
>    
>  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.
>  
> ------------------------------------------------------------------------
>
> No virus found in this incoming message.
> Checked by AVG.
> Version: 7.5.519 / Virus Database: 269.22.1/1347 - Release Date: 27/03/2008 7:15 PM
>  


Attachment: user_184799.ezm (zipped)
Hi all,

i am facing a problem while validating the login form..
i have to validate it in two ways:

1) Have to check if the requiredinput fields are filled and are in line with
the laid procedure.

for this i am using the server side validation.i have developed a xml for
validating the fields and it is running fine and validationg the entries.
for displaying i am using <s:head/> tag

2) Second case is where i have to check if the useris valid with respect to
the database, and in my action class i am using a

addFieldError("UserID", "Either User name or Password is Wrong"); and

<s:fielderror/> to display he error but these two are not working
together,my server side validation is working fine but the otheris not
working

only one is working ata time.any help in this regard is much appricaisted.



-aum
©2008 gg3721.com - Jax Systems, LLC, U.S.A.