Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

user Digest 26 Mar 2008 17:19:34 -0000 Issue 7945

user-digest-help

2008-03-26


Author LoginPost Reply

user Digest 26 Mar 2008 17:19:34 -0000 Issue 7945

Topics (messages 184640 through 184669):

Re: How to enable the client side validation?
 184640 by: Chen Chunwei

struts2 dojo plugin (ajax)
 184641 by: Daniel

Use of ExtJS
 184642 by: Prashant Saraf
 184645 by: Alvaro Sanchez-Mariscal
 184663 by: Frans Thamura
 184665 by: Martin Gainty
 184666 by: Dave Newton

Struts 2 and an array of textfields
 184643 by: Eugen Stoianovici

Re: RE : How to eliminate an entry from an array with s2 tags
 184644 by: Dave Newton

interceptor throwing global exception
 184646 by: Hartrich, James CTR USTRANSCOM J6

Struts2 Action instances are not getting garbage collected
 184647 by: Prajapati Manish Narandas

Automatic creation of beans
 184648 by: Joachim Ansorg

Struts2 validation issue when internet is not available in the application server.
 184649 by: Nuwan Chandrasoma
 184651 by: Dave Newton
 184652 by: Martin Gainty
 184656 by: Nuwan Chandrasoma
 184657 by: Dave Newton
 184659 by: Nuwan Chandrasoma
 184660 by: Dave Newton

struts 2 ajax how to
 184650 by: Daniel
 184653 by: Deepak Kumar
 184667 by: Piero Sartini

eclipse and struts 2
 184654 by: Prashant Saraf

RE : RE : How to eliminate an entry from an array with s2 tags
 184655 by: Ezequiel Puig

Zero config and interceptors do not get along?
 184658 by: Alex Shneyderman
 184661 by: Dave Newton
 184662 by: Ealden Escañan

Re: Actions/DAO interaction getting messy...
 184664 by: Eric D Nielsen

how to show error fields ONLY in validation?
 184668 by: xianwinwin

Struts 2.1 autocompleter, get the value
 184669 by: sassien

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_184640.ezm (zipped)
Sorry for mis-typing.

>But I wonder know ...

should be

But I wanna know...

Talos
----- Original Message -----
From: "Chen Chunwei" <out-chenchunwei@(protected)>
To: "Struts Users Mailing List" <user@(protected)>
Sent: Wednesday, March 26, 2008 5:34 PM
Subject: Re: How to enable the client side validation?


I found the answer.

There's an attribute in <html:javascript> named method. You can specify a name in this attribute such as validateForm. Then specify the onsubmit event of the actual form with "return validateForm(this);". After all, the javascript works.

The above solution comes from my colleague. But I wonder know is there any document refer to this? Or it should be a common sense?

Talos

----- Original Message -----
From: "Antonio Petrelli" <antonio.petrelli@(protected)>
To: "Struts Users Mailing List" <user@(protected)>
Sent: Wednesday, March 26, 2008 5:18 PM
Subject: Re: How to enable the client side validation?


2008/3/26, Chen Chunwei <out-chenchunwei@(protected)>:
>
> Well, the case is that the Javascript code was generated well, but it was
> not triggered.



Well, that's strange. Can you post, the generated HTML and Javascript code?
What browser are you using? Changing browser changes anything?

Antonio

Attachment: user_184641.ezm (zipped)
I am trying to integrate struts and ajax trough dojo plugin. Freemarker is
trowing me an error :

freemarker.core.InvalidReferenceException: Expression parameters.pushId is
undefined on line 97, column 6 in template/ajax/submit.ftl.

Anyone know what that mean?

This is my jsp page :

<s:form name="search" action="search" namespace="/s" id="searchForm">
  <table width="100%" align="center" cellpadding="0" cellspacing="0">
    <tr>
       <td style="padding:10px;">

            <table width="50%" align="center" cellpadding="0"
cellspacing="0">
               <tr>
                  <td>
                    <s:textfield name="doc1" label="doc1"/>
                        <s:submit value="Seach" theme="ajax"
id="searchPutton"/>
                  </td>
               </tr>
            </table>

       </td>
    </tr>
  </table>

</s:form>

My libs :

struts2-dojo-plugin-2.1.1-SNAPSHOT.jar
struts2-core-2.1.1-SNAPSHOT.jar

Attachment: user_184642.ezm (zipped)
Hi,

Can we use ExtJS with Struts 2 Tags?

Regards,
Prashant.

Attachment: user_184645.ezm (zipped)
> Can we use ExtJS with Struts 2 Tags?

Nope. However, you can use ExtJS (or any other) directly without S2 ajax tags.

Alvaro.


--
Alvaro Sanchez-Mariscal Arnaiz
Java EE Architect & Instructor
alvaro.sanchezmariscal@(protected)

Attachment: user_184663.ezm (zipped)
i am using GWT-Ext with S2, but still shocked with structure of GWT and
Struts2 (EclipseDynamicProject) here.

may be anyone have a share, that will be cool

F

Attachment: user_184665.ezm (zipped)
so a conversion from Dojo to GWT ?

you would first have to scan all ftl
e.g. here are the contents of head.ftl
<script type="text/javascript"
    src="<@(protected)'
includeParams='none' encode='false' />"></script>

then replace ALL instances of Dojo's javascript .js with GWT equivalent

Before attempting this conversion is there a specific component or feature
you're looking for ?
You might be pleasantly surprised by the features and functions that Dojo
1.0 has to offer..

?
Martin-
----- Original Message -----
From: "Frans Thamura" <frans@(protected)>
To: "Struts Users Mailing List" <user@(protected)>
Sent: Wednesday, March 26, 2008 10:21 AM
Subject: Re: Use of ExtJS


> i am using GWT-Ext with S2, but still shocked with structure of GWT and
> Struts2 (EclipseDynamicProject) here.
>
> may be anyone have a share, that will be cool
>
> F
>


Attachment: user_184666.ezm (zipped)
--- Martin Gainty <mgainty@(protected):
> so a conversion from Dojo to GWT ?

I think ExtJS, if the subject line is any indication.

> you would first have to scan all ftl
> e.g. here are the contents of head.ftl
> <script type="text/javascript"
>      src="<@(protected)'
> includeParams='none' encode='false' />"></script>
>
> then replace ALL instances of Dojo's javascript .js with GWT equivalent

That's certainly amongst the first steps, but there are so many other steps
that are so much more complicated that it doesn't really seem worth
mentioning.

> You might be pleasantly surprised by the features and functions that Dojo
> 1.0 has to offer..

But S2 doesn't use Dojo 1.0, so the tags aren't particularly relevant.

Dave


Attachment: user_184643.ezm (zipped)
How do i handle an array of textfields?
I have a form from which the user must check a list of checkboxes and
enter some text in a textfield that must be associated with a textbox
My action extends ActionSupport and i'm using s2



Attachment: user_184644.ezm (zipped)
Why wouldn't you just use the collection of checkboxes that have been
checked?

Maybe I'm not understanding correctly, but I don't see any reason to remove
anything from an array; whether you're using JavaScript to build the URL or
not. Why do you need to remove the ID from the array?

Dave

--- Ezequiel Puig <e.puig@(protected):

> Hi Dave,
>
> Thanks for your reponse. Anyway, I will try to convince you ;)
>
> Some background: i have a page where a list of products are shown. In that
> page there is a button to compare products. What the button does is collect
> all the selected product's id and call an action:
> CompareProducts.do?productID=111&productID=222 etc. As the product
> selection is done by the user, the complete url is created with javascript
> :(. Consequently, the action CompareProducts has an array like that:
> String[] productID. So, when the action returns the page, i can access the
> array productID.
> What i want to do is to put an button in the comparation page that allows
> the user to deselect a product. So, i need to call the action
> CompareProducts with all the ids (productID) removing the product's id that
> has been deselected.
> And i want to do that with s2 tags and not with javascript.
>
> Well, i hope it's a little bit more clear.
>
> Thanks,
>
> Ezequiel.
>
>
> -----Message d'origine-----
> De : Dave Newton [mailto:newton.dave@(protected)]
> Envoyé : mardi 25 mars 2008 13:08
> À : Struts Users Mailing List
> Objet : Re: How to eliminate an entry from an array with s2 tags
>
>
> --- Ezequiel Puig <e.puig@(protected):
> > in my jsp, i have an array of ids and i will like to remove one of
> > that ids using s2 tags:
> >
> > I have tried the following, but it doesn't work :(
> > <s:set name="allIDs" value="#parameters.productCode"/>
> > <s:set name="newID" value=""/>
> > <s:iterator value="#allIDs" status="stat">
> >   <s:set name="myID" value="top"/>
> >   <s:if test='%{ idToRemove != #myID }'>
> >      <s:set name="newID[#stat]" value="#myID"/>
> >   </s:if>
> > </s:iterator>
> >
> > Does anyone know how to do it ?
>
> Depending on the underlying collection type you might get an exception.
> You're not removing anything in the above code anyway, you're replacing a
> value. You're also using the "status" value like it's an index, but it's
> not [1].
>
> But why? You'd have to work hard to convince me that the JSP is the place
> to do something like that.
>
> Dave
>
> [1]
>
http://struts.apache.org/2.0.11.1/struts2-core/apidocs/org/apache/struts2/views/jsp/IteratorStatus.html
>
>
> ---------------------------------------------------------------------
> 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_184646.ezm (zipped)
I'm struggling with configuring struts.xml global-results and global-exception-mappings for any exception thrown from an interceptor.
What do I need to do to keep a request out of my action and instead go to the configured global-result?
 
James

Attachment: smime.p7s (zipped)
Attachment: user_184647.ezm (zipped)
Hi All,
I am using struts2 with spring object factory.
Here, spring is creating action class objects with request scope and
injecting service layer dependency and service layer objects are singleton
scope.

here, even i have given request scope it doesnt ensure 100 % garbage
collection of my all action class objects.

Can anybody tell me a way so i can find all action objects garbage
collected once action class has done
its work.

Thanx in advance.

Regards,
manish

Attachment: user_184648.ezm (zipped)
Hi there,
I have an action which is configured to use the paramsPrepareParams
interceptor.

Basically the action is:

public class UserAdminAction implements Preparable {
  // user is an interface, prepare() assign an implementation to the field
  private User user;
  private String username;

  public void prepare() throws Exception {
       user = StringUtils.isEmpty(username) ? mgr.createUser("new
user") : mgr.findByUsername(username);
      //...
  }

// getters for user, username
// setter for username, ...
}

In the first parameters run the user is null, which is fine.
But Struts tries to create a new one due to some parameters of user
properties. This not successful because it's an interface. I don't have
a setter for user anyway.

How can I switch of the automatic creation of fields in the
(parameters?) interceptor?

Thanks a lot for any hints,
Joachim


Attachment: user_184649.ezm (zipped)
Hi All,

Has any one come across this issue? . we dont have internet in our app
server and the struts2 validation fails as it cant access
www.opensymphony.com.

Thanks,

Nuwan.

Caused by: java.lang.reflect.InvocationTargetException
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
  at java.lang.reflect.Method.invoke(Unknown Source)
  at freemarker.ext.beans.BeansWrapper.invokeMethod (BeansWrapper.java:616)
  at
freemarker.ext.beans.SimpleMethodModel.exec (SimpleMethodModel.java:113)
  ... 160 more
Caused by: java.lang.ExceptionInInitializerError
  at
com.opensymphony.xwork2.validator.ValidatorFileParser.addValidatorConfigs (ValidatorFileParser.java:177)
  at
com.opensymphony.xwork2.validator.ValidatorFileParser.parseActionValidatorConfigs (ValidatorFileParser.java:72)
  at
com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.loadFile (AnnotationActionValidatorManager.java:357)
  at com.opensymphony.xwork2.va
26 Mar 2008 17:58:04,489 INFO [STDOUT]
lidator.AnnotationActionValidatorManager.buildAliasValidatorConfigs(AnnotationActionValidatorManager.java:240)
  at
com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.buildValidatorConfigs (AnnotationActionValidatorManager.java:339)
  at
com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.getValidators (AnnotationActionValidatorManager.java:69)
  at
com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.getValidators (AnnotationActionValidatorManager.java:49)
  at org.apache.struts2.components.Form.getValidators (Form.java:412)
  ... 166 more
Caused by: www.opensymphony.com - [unknown location]
  at com.opensymphony.xwork2.util.DomHelper.parse (DomHelper.java:123)
  at com.opensymphony.xwork2.util.DomHelper.parse (DomHelper.java:71)
  at
com.opensymphony.xwork2.validator.ValidatorFileParser.parseValidatorDefinitions (ValidatorFileParser.java:114)
  at
com.opensymphony.xwork2.validator.ValidatorFileParser.parseValidatorDefinitions (ValidatorFileParser.java:99)
  at
com.opensymphony.xwork2.validator.ValidatorFactory.parseValidators (ValidatorFactory.java:314)
  at
com.opensymphony.xwork2.validator.ValidatorFactory.<clinit>(ValidatorFactory.java:220)
  ... 174 more
Caused by: java.net.UnknownHostException: www.opensymphony.com
  at java.net.PlainSocketImpl.connect(Unknown Source)
  at java.net.Socket.connect(Unknown Source)
  at java.net.Socket.connect(Unknown Source)
  at sun.net.NetworkClient.doConnect(Unknown Source)
  at sun.net.www.http.HttpClient.openServer(Unknown Source)
  at sun.net.www.http.HttpClient.openServer(Unknown Source)
  at sun.net.www.http.HttpClient.<init>(Unknown Source)
  at sun.net.www.http.HttpClient.New(Unknown Source)
  at sun.net.www.http.HttpClient.New(Unknown Source)
  at
sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
  at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown
Source)
  at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
  at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
  at
org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
  at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source)
  at org.apache.xerces.impl.XMLEntityManager.startDTDEntity(Unknown
Source)
  at org.apache.xerces.impl.XMLDTDScannerImpl.setInputSource(Unknown
Source)
  at
org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(Unknown
Source)
  at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
  at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
  at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
  at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
  at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
  at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown
Source)
  at javax.xml.parsers.SAXParser.parse(Unknown Source)
  at com.opensymphony.xwork2.util.DomHelper.parse (DomHelper.java:121)
  ... 179 more

Attachment: user_184651.ezm (zipped)
Is your DTD correct?

As a trivial test I turned off my WiFi and restarted a webapp that uses a
validation configuration file and no issues throught he startup or validation
process.

Dave

--- Nuwan Chandrasoma <mymailnot@(protected):

> Hi All,
>
> Has any one come across this issue? . we dont have internet in our app
> server and the struts2 validation fails as it cant access
> www.opensymphony.com.
>
> Thanks,
>
> Nuwan.
>
> Caused by: java.lang.reflect.InvocationTargetException
>   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>   at java.lang.reflect.Method.invoke(Unknown Source)
>   at
> freemarker.ext.beans.BeansWrapper.invokeMethod (BeansWrapper.java:616)
>   at
> freemarker.ext.beans.SimpleMethodModel.exec (SimpleMethodModel.java:113)
>   ... 160 more
> Caused by: java.lang.ExceptionInInitializerError
>   at
>
com.opensymphony.xwork2.validator.ValidatorFileParser.addValidatorConfigs (ValidatorFileParser.java:177)
>   at
>
com.opensymphony.xwork2.validator.ValidatorFileParser.parseActionValidatorConfigs (ValidatorFileParser.java:72)
>   at
>
com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.loadFile (AnnotationActionValidatorManager.java:357)
>   at com.opensymphony.xwork2.va
> 26 Mar 2008 17:58:04,489 INFO [STDOUT]
>
lidator.AnnotationActionValidatorManager.buildAliasValidatorConfigs(AnnotationActionValidatorManager.java:240)
>   at
>
com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.buildValidatorConfigs (AnnotationActionValidatorManager.java:339)
>   at
>
com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.getValidators (AnnotationActionValidatorManager.java:69)
>   at
>
com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.getValidators (AnnotationActionValidatorManager.java:49)
>   at org.apache.struts2.components.Form.getValidators (Form.java:412)
>   ... 166 more
> Caused by: www.opensymphony.com - [unknown location]
>   at com.opensymphony.xwork2.util.DomHelper.parse (DomHelper.java:123)
>   at com.opensymphony.xwork2.util.DomHelper.parse (DomHelper.java:71)
>   at
>
com.opensymphony.xwork2.validator.ValidatorFileParser.parseValidatorDefinitions (ValidatorFileParser.java:114)
>   at
>
com.opensymphony.xwork2.validator.ValidatorFileParser.parseValidatorDefinitions (ValidatorFileParser.java:99)
>   at
>
com.opensymphony.xwork2.validator.ValidatorFactory.parseValidators (ValidatorFactory.java:314)
>   at
>
com.opensymphony.xwork2.validator.ValidatorFactory.<clinit>(ValidatorFactory.java:220)
>   ... 174 more
> Caused by: java.net.UnknownHostException: www.opensymphony.com
>   at java.net.PlainSocketImpl.connect(Unknown Source)
>   at java.net.Socket.connect(Unknown Source)
>   at java.net.Socket.connect(Unknown Source)
>   at sun.net.NetworkClient.doConnect(Unknown Source)
>   at sun.net.www.http.HttpClient.openServer(Unknown Source)
>   at sun.net.www.http.HttpClient.openServer(Unknown Source)
>   at sun.net.www.http.HttpClient.<init>(Unknown Source)
>   at sun.net.www.http.HttpClient.New(Unknown Source)
>   at sun.net.www.http.HttpClient.New(Unknown Source)
>   at
> sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown
> Source)
>   at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown
> Source)
>   at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
>   at
> sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
>   at
> org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
>   at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source)
>   at org.apache.xerces.impl.XMLEntityManager.startDTDEntity(Unknown
> Source)
>   at org.apache.xerces.impl.XMLDTDScannerImpl.setInputSource(Unknown
> Source)
>   at
>
org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(Unknown
>
> Source)
>   at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
> Source)
>   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
>   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
>   at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
>   at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
>   at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown
> Source)
>   at javax.xml.parsers.SAXParser.parse(Unknown Source)
>   at com.opensymphony.xwork2.util.DomHelper.parse (DomHelper.java:121)
>   ... 179 more
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>


Attachment: user_184652.ezm (zipped)
So to take an example in the supplied validators xml

<validators>
  <field name="count">
    <field-validator type="int" short-circuit="true">
       <param name="min">1</param>
       <param name="max">100</param>
       <message key="invalid.count">Invalid Count!</message>
    </field-validator>
    <field-validator type="int">
       <param name="min">20</param>
       <param name="max">80</param>
       <message key="invalid.count.bad">Smaller Invalid Count:
${count}</message>
    </field-validator>
  </field>
</validators>

The xwork package ValidatorFileParser.java hunts for
type attribute of <field-validator> element
short-circuit attribute of <field-validator>

param <sub> element
  name attribute of <sub>element

message element
  key attribute of the message element

M-
----- Original Message -----
From: "Nuwan Chandrasoma" <mymailnot@(protected)>
To: "Struts Users Mailing List" <user@(protected)>
Sent: Wednesday, March 26, 2008 8:16 AM
Subject: Struts2 validation issue when internet is not available in the
application server.


> Hi All,
>
> Has any one come across this issue? . we dont have internet in our app
> server and the struts2 validation fails as it cant access
> www.opensymphony.com.
>
> Thanks,
>
> Nuwan.
>
> Caused by: java.lang.reflect.InvocationTargetException
>   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>   at java.lang.reflect.Method.invoke(Unknown Source)
>   at
freemarker.ext.beans.BeansWrapper.invokeMethod (BeansWrapper.java:616)
>   at
> freemarker.ext.beans.SimpleMethodModel.exec (SimpleMethodModel.java:113)
>   ... 160 more
> Caused by: java.lang.ExceptionInInitializerError
>   at
>
com.opensymphony.xwork2.validator.ValidatorFileParser.addValidatorConfigs(Va
lidatorFileParser.java:177)
>   at
>
com.opensymphony.xwork2.validator.ValidatorFileParser.parseActionValidatorCo
nfigs(ValidatorFileParser.java:72)
>   at
>
com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.loadFile(
AnnotationActionValidatorManager.java:357)
>   at com.opensymphony.xwork2.va
> 26 Mar 2008 17:58:04,489 INFO [STDOUT]
>
lidator.AnnotationActionValidatorManager.buildAliasValidatorConfigs(Annotati
onActionValidatorManager.java:240)
>   at
>
com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.buildVali
datorConfigs(AnnotationActionValidatorManager.java:339)
>   at
>
com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.getValida
tors(AnnotationActionValidatorManager.java:69)
>   at
>
com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.getValida
tors(AnnotationActionValidatorManager.java:49)
>   at org.apache.struts2.components.Form.getValidators (Form.java:412)
>   ... 166 more
> Caused by: www.opensymphony.com - [unknown location]
>   at com.opensymphony.xwork2.util.DomHelper.parse (DomHelper.java:123)
>   at com.opensymphony.xwork2.util.DomHelper.parse (DomHelper.java:71)
>   at
>
com.opensymphony.xwork2.validator.ValidatorFileParser.parseValidatorDefiniti
ons(ValidatorFileParser.java:114)
>   at
>
com.opensymphony.xwork2.validator.ValidatorFileParser.parseValidatorDefiniti
ons(ValidatorFileParser.java:99)
>   at
>
com.opensymphony.xwork2.validator.ValidatorFactory.parseValidators(Validator
Factory.java:314)
>   at
>
com.opensymphony.xwork2.validator.ValidatorFactory.<clinit>(ValidatorFactory
java:220)
>   ... 174 more
> Caused by: java.net.UnknownHostException: www.opensymphony.com
>   at java.net.PlainSocketImpl.connect(Unknown Source)
>   at java.net.Socket.connect(Unknown Source)
>   at java.net.Socket.connect(Unknown Source)
>   at sun.net.NetworkClient.doConnect(Unknown Source)
>   at sun.net.www.http.HttpClient.openServer(Unknown Source)
>   at sun.net.www.http.HttpClient.openServer(Unknown Source)
>   at sun.net.www.http.HttpClient.<init>(Unknown Source)
>   at sun.net.www.http.HttpClient.New(Unknown Source)
>   at sun.net.www.http.HttpClient.New(Unknown Source)
>   at
> sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown
Source)
>   at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown
> Source)
>   at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
>   at
> sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
>   at
> org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
>   at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source)
>   at org.apache.xerces.impl.XMLEntityManager.startDTDEntity(Unknown
> Source)
>   at org.apache.xerces.impl.XMLDTDScannerImpl.setInputSource(Unknown
> Source)
>   at
>
org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(Unknown
> Source)
>   at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
> Source)
>   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
>   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
>   at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
>   at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
>   at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown
> Source)
>   at javax.xml.parsers.SAXParser.parse(Unknown Source)
>   at com.opensymphony.xwork2.util.DomHelper.parse (DomHelper.java:121)
>   ... 179 more
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>


Attachment: user_184656.ezm (zipped)
This is my xml file. when we run in a local machine that has internet
access this works fine.

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE validators PUBLIC

      "-//OpenSymphony Group//XWork Validator 1.0.2//EN"

      "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">



<validators>

  <field name="username">

    <field-validator type="required">
       <message>Login name is required</message>

    </field-validator>

  </field>

  <field name="password">

    <field-validator type="required">
       <message>Password is required</message>

    </field-validator>

  </field>

</validators>

Dave Newton wrote:
> Is your DTD correct?
>
> As a trivial test I turned off my WiFi and restarted a webapp that uses a
> validation configuration file and no issues throught he startup or validation
> process.
>
> Dave
>
> --- Nuwan Chandrasoma <mymailnot@(protected):
>
>  
>> Hi All,
>>
>> Has any one come across this issue? . we dont have internet in our app
>> server and the struts2 validation fails as it cant access
>> www.opensymphony.com.
>>
>> Thanks,
>>
>> Nuwan.
>>
>> Caused by: java.lang.reflect.InvocationTargetException
>>   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>>   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>>   at java.lang.reflect.Method.invoke(Unknown Source)
>>   at
>> freemarker.ext.beans.BeansWrapper.invokeMethod (BeansWrapper.java:616)
>>   at
>> freemarker.ext.beans.SimpleMethodModel.exec (SimpleMethodModel.java:113)
>>   ... 160 more
>> Caused by: java.lang.ExceptionInInitializerError
>>   at
>>
>>  
> com.opensymphony.xwork2.validator.ValidatorFileParser.addValidatorConfigs (ValidatorFileParser.java:177)
>  
>>   at
>>
>>  
> com.opensymphony.xwork2.validator.ValidatorFileParser.parseActionValidatorConfigs (ValidatorFileParser.java:72)
>  
>>   at
>>
>>  
> com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.loadFile (AnnotationActionValidatorManager.java:357)
>  
>>   at com.opensymphony.xwork2.va
>> 26 Mar 2008 17:58:04,489 INFO [STDOUT]
>>
>>  
> lidator.AnnotationActionValidatorManager.buildAliasValidatorConfigs(AnnotationActionValidatorManager.java:240)
>  
>>   at
>>
>>  
> com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.buildValidatorConfigs (AnnotationActionValidatorManager.java:339)
>  
>>   at
>>
>>  
> com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.getValidators (AnnotationActionValidatorManager.java:69)
>  
>>   at
>>
>>  
> com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.getValidators (AnnotationActionValidatorManager.java:49)
>  
>>   at org.apache.struts2.components.Form.getValidators (Form.java:412)
>>   ... 166 more
>> Caused by: www.opensymphony.com - [unknown location]
>>   at com.opensymphony.xwork2.util.DomHelper.parse (DomHelper.java:123)
>>   at com.opensymphony.xwork2.util.DomHelper.parse (DomHelper.java:71)
>>   at
>>
>>  
> com.opensymphony.xwork2.validator.ValidatorFileParser.parseValidatorDefinitions (ValidatorFileParser.java:114)
>  
>>   at
>>
>>  
> com.opensymphony.xwork2.validator.ValidatorFileParser.parseValidatorDefinitions (ValidatorFileParser.java:99)
>  
>>   at
>>
>>  
> com.opensymphony.xwork2.validator.ValidatorFactory.parseValidators (ValidatorFactory.java:314)
>  
>>   at
>>
>>  
> com.opensymphony.xwork2.validator.ValidatorFactory.<clinit>(ValidatorFactory.java:220)
>  
>>   ... 174 more
>> Caused by: java.net.UnknownHostException: www.opensymphony.com
>>   at java.net.PlainSocketImpl.connect(Unknown Source)
>>   at java.net.Socket.connect(Unknown Source)
>>   at java.net.Socket.connect(Unknown Source)
>>   at sun.net.NetworkClient.doConnect(Unknown Source)
>>   at sun.net.www.http.HttpClient.openServer(Unknown Source)
>>   at sun.net.www.http.HttpClient.openServer(Unknown Source)
>>   at sun.net.www.http.HttpClient.<init>(Unknown Source)
>>   at sun.net.www.http.HttpClient.New(Unknown Source)
>>   at sun.net.www.http.HttpClient.New(Unknown Source)
>>   at
>> sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown
>> Source)
>>   at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown
>> Source)
>>   at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
>>   at
>> sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
>>   at
>> org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
>>   at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source)
>>   at org.apache.xerces.impl.XMLEntityManager.startDTDEntity(Unknown
>> Source)
>>   at org.apache.xerces.impl.XMLDTDScannerImpl.setInputSource(Unknown
>> Source)
>>   at
>>
>>  
> org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(Unknown
>  
>> Source)
>>   at
>> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
>> Source)
>>   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
>>   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
>>   at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
>>   at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
>>   at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown
>> Source)
>>   at javax.xml.parsers.SAXParser.parse(Unknown Source)
>>   at com.opensymphony.xwork2.util.DomHelper.parse (DomHelper.java:121)
>>   ... 179 more
>>
>> ---------------------------------------------------------------------
>> 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_184657.ezm (zipped)
--- Nuwan Chandrasoma <mymailnot@(protected):
> This is my xml file. when we run in a local machine that has internet
> access this works fine.
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE validators PUBLIC
>       "-//OpenSymphony Group//XWork Validator 1.0.2//EN"
>       "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">

Hmm, AFAICT that's exactly what I'm using.

What container are you running in? I'm running via a local Tomcat via Eclipse
Europa; it's possible that Eclipse has cached my DTD or something. I'll look
in to it a bit more.

Dave



Attachment: user_184659.ezm (zipped)
I am using jboss-4.0.5-GA

Dave Newton wrote:
> --- Nuwan Chandrasoma <mymailnot@(protected):
>  
>> This is my xml file. when we run in a local machine that has internet
>> access this works fine.
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <!DOCTYPE validators PUBLIC
>>       "-//OpenSymphony Group//XWork Validator 1.0.2//EN"
>>       "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
>>  
>
> Hmm, AFAICT that's exactly what I'm using.
>
> What container are you running in? I'm running via a local Tomcat via Eclipse
> Europa; it's possible that Eclipse has cached my DTD or something. I'll look
> in to it a bit more.
>
> Dave
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>  


Attachment: user_184660.ezm (zipped)
--- Dave Newton <newton.dave@(protected):
> --- Nuwan Chandrasoma <mymailnot@(protected):
> > This is my xml file. when we run in a local machine that has internet
> > access this works fine.
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <!DOCTYPE validators PUBLIC
> >       "-//OpenSymphony Group//XWork Validator 1.0.2//EN"
> >       "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
>
> Hmm, AFAICT that's exactly what I'm using.
>
> What container are you running in? I'm running via a local Tomcat via
> Eclipse Europa; it's possible that Eclipse has cached my DTD or
> something. I'll look in to it a bit more.

Just as a quick followup, with no internet access and no DTD caching it still
seems to work okay.

It's also giving me confusing log entries; I have no annotations in my action
class that's being validated, but the debugs are from the annotation
validation manager. The messages being displayed are from the XML file. So
I'm a little lost and potentially less useful than I thought ;)

Dave


Attachment: user_184650.ezm (zipped)
Hello,
What is the best solution to integrate struts 2 and ajax? What libraries?

Attachment: user_184653.ezm (zipped)
HI,

Dojo comes with struts 2. You can use dojo in your struts 2 applications.

Please learn it from
http://www.roseindia.net/struts/struts2/struts2ajax/index.shtml

Thanks


-----Original Message-----
From: Daniel [mailto:pdaniel2005@(protected)]
Sent: Wednesday, March 26, 2008 7:05 PM
To: user@(protected)
Subject: struts 2 ajax how to


Hello,
What is the best solution to integrate struts 2 and ajax? What libraries?


Attachment: user_184667.ezm (zipped)
Am Mittwoch, 26. März 2008 14:35:26 schrieb Daniel:
> Hello,
> What is the best solution to integrate struts 2 and ajax? What libraries?

DOJO is shipped with Struts2 - but my impression is that most people do use
other frameworks like jQuery or prototype, writing their AJAX code by hand.

I will do it this way in my next project using the simple theme (or maybe
writing a custom one...). The s2 ajax theme has too many issues and is not
flexible enough in my oppinion.

 Piero

Attachment: user_184654.ezm (zipped)
Hi,
 I am using eclipse for creating struts 2 application. I have few
doubts.
1. does it is necessary to put all pojo classes(action/form) into
WEB-INF/classes/appName?
2. can someone provide project structure of struts 2 project in eclipse?



Attachment: user_184655.ezm (zipped)
Hi,

1) I am not using the collection of checkboxes because the user can check products in different pages.
2) I was thinking in removing the element from the array with s2 tags because like that i can construct an url to emininate the product:
<s:url action='CompareProducts.do' includeParams='none'><s:param name='productCode' value='#arrayWithoutMyID' />.
And why i want ot do that ? Because like that the page can be easily read by search engines :( .

Well, it's not really a problem, so we can let it here.

Thanks for your help.

Ezequiel.

-----Message d'origine-----
De : Dave Newton [mailto:newton.dave@(protected)]
Envoyé : mercredi 26 mars 2008 13:28
À : Struts Users Mailing List
Objet : Re: RE : How to eliminate an entry from an array with s2 tags


Why wouldn't you just use the collection of checkboxes that have been checked?

Maybe I'm not understanding correctly, but I don't see any reason to remove anything from an array; whether you're using JavaScript to build the URL or not. Why do you need to remove the ID from the array?

Dave

--- Ezequiel Puig <e.puig@(protected):

> Hi Dave,
>
> Thanks for your reponse. Anyway, I will try to convince you ;)
>
> Some background: i have a page where a list of products are shown. In
> that page there is a button to compare products. What the button does
> is collect all the selected product's id and call an action:
> CompareProducts.do?productID=111&productID=222 etc. As the product
> selection is done by the user, the complete url is created with
> javascript :(. Consequently, the action CompareProducts has an array
> like that: String[] productID. So, when the action returns the page, i
> can access the array productID. What i want to do is to put an button
> in the comparation page that allows the user to deselect a product.
> So, i need to call the action CompareProducts with all the ids
> (productID) removing the product's id that has been deselected.
> And i want to do that with s2 tags and not with javascript.
>
> Well, i hope it's a little bit more clear.
>
> Thanks,
>
> Ezequiel.
>
>
> -----Message d'origine-----
> De : Dave Newton [mailto:newton.dave@(protected)]
> Envoyé : mardi 25 mars 2008 13:08
> À : Struts Users Mailing List
> Objet : Re: How to eliminate an entry from an array with s2 tags
>
>
> --- Ezequiel Puig <e.puig@(protected):
> > in my jsp, i have an array of ids and i will like to remove one of
> > that ids using s2 tags:
> >
> > I have tried the following, but it doesn't work :(
> > <s:set name="allIDs" value="#parameters.productCode"/> <s:set
> > name="newID" value=""/> <s:iterator value="#allIDs" status="stat">
> >   <s:set name="myID" value="top"/>
> >   <s:if test='%{ idToRemove != #myID }'>
> >      <s:set name="newID[#stat]" value="#myID"/>
> >   </s:if>
> > </s:iterator>
> >
> > Does anyone know how to do it ?
>
> Depending on the underlying collection type you might get an
> exception. You're not removing anything in the above code anyway,
> you're replacing a value. You're also using the "status" value like
> it's an index, but it's not [1].
>
> But why? You'd have to work hard to convince me that the JSP is the
> place to do something like that.
>
> Dave
>
> [1]
>
http://struts.apache.org/2.0.11.1/struts2-core/apidocs/org/apache/struts2/views/jsp/IteratorStatus.html
>
>
> ---------------------------------------------------------------------
> 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)
>
>


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


Attachment: user_184658.ezm (zipped)
I have a custom interceptor that I define in the root of my profect
and then I define my custom interceptorStack and define that as
default interceptor stack.

If any of my actions are running automatically via Zero-config option
all works well but interceptor does not trigger. If I specify my
action (that can be found automatically by zero config magic) inside
my struts.xml everything starts working.

Anyone knows what the problems is? There must be something I am
missing otherwise the situation renders Zero-config almost useless.

Thanks,
Alex.

Attachment: user_184661.ezm (zipped)
I'd try using the @ParentPackage annotation in your actions first; that seems
to be the workaround for not having appropriate interceptor annotations.

Dave

--- Alex Shneyderman <a.shneyderman@(protected):
> I have a custom interceptor that I define in the root of my profect
> and then I define my custom interceptorStack and define that as
> default interceptor stack.
>
> If any of my actions are running automatically via Zero-config option
> all works well but interceptor does not trigger. If I specify my
> action (that can be found automatically by zero config magic) inside
> my struts.xml everything starts working.
>
> Anyone knows what the problems is? There must be something I am
> missing otherwise the situation renders Zero-config almost useless.
>
> Thanks,
> Alex.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>


Attachment: user_184662.ezm (zipped)
On Wed, Mar 26, 2008 at 10:16 PM, Alex Shneyderman
<a.shneyderman@(protected):
> I have a custom interceptor that I define in the root of my profect
> and then I define my custom interceptorStack and define that as
> default interceptor stack.
>
> If any of my actions are running automatically via Zero-config option
> all works well but interceptor does not trigger. If I specify my
> action (that can be found automatically by zero config magic) inside
> my struts.xml everything starts working.
>
> Anyone knows what the problems is? There must be something I am
> missing otherwise the situation renders Zero-config almost useless.
>

I believe you need to add @ParentPackage to your annotation:

https://issues.apache.org/struts/browse/WW-2016?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_42116

--
Ealden Esto E. Escañan
http://blog.ealden.net

Attachment: user_184664.ezm (zipped)
Adam Hardy on 26/03/08 00:28:43
>Eric D Nielsen on 25/03/08 14:29, wrote:
>> Its a Struts2/Spring2/JPA(Hibernate) based project. I'm using a slightly
>> modified version of the Generic DAO pattern shown in the Java persistence
>> with Hibernate book and/or the IBM ThoughtWorks very similar example.
>> (Modified to allow Spring Based Injection of the JPA EntityManger, while
>> falling back to a native Hibernate session inside the DAOs to allow a few
>> more optimizations).
>>
>> So its basically
>> Business Objects (POJOs) <---1:1---> DAOs
>> which is a relatively normal pattern I beleive.
>
>Is it normal with that Generic DAO pattern to name the DAOs 'services'? In the
>Domain-Driven-Design paradigm that I generally follow, the services are objects
>which carry out operations that you don't want to specifically assign to one
>domain object.

I'm willing to admit a LOT of confusion about DAOs v (Services | Managers) v
business logic on POJOs. I will say that my Actions are taking things named
"services" but typed as DAOs since I thought I would eventually migrate towards
this extra tier, but have let to really understand what belongs there. I think
a large part of my confusion comes from most examples I've seen where just
about 100% of the method in the vast majority of service classes are proxied
calls from the DAO. With only 1-2 methods added to a small percentage of the
services. However we are getting quite far afield for Struts matters here.....
I'd be very happy to receive further enlightenment, but if its better to move
this part of the discussion elswhere, please let me know...

>> just use POJOs there. I believe this approach would work with the
>> Model-Driven idea, but it feels a little odd to me to mark up the domain
>> object with HTTP-specific details....
>
>Yes it would do, but what do you mean by 'mark up the domain object with
>HTTP-specific details'? I don't think you have to touch the domain objects to
>code the re-construction of your incoming Bug POJO.

Yay! Back to Struts matters...  I haven't written any type converters yet, but
from the examples I'd been seeing I thought you had to add a @TypeConversion
annotation to accessors that wanted custom type conversion.
http://struts.apache.org/2.x/docs/typeconversion-annotation.html
So if I was using Model Driven, would this mean putting these annotation on the
model. (much like the Vistor pattern for Validation)


Eric



Attachment: user_184668.ezm (zipped)

Hi guys,

when a user clicks Submit in my form, a message is returned to an ID with
the following errors:

you have an error in your date entry!

Invalid field value for field "age". 336r
IL
3/15/07


the JSP page looks like this:

<%@(protected)" %>

<%
  request.setAttribute("decorator", "none");
  response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
  response.setHeader("Pragma","no-cache"); //HTTP 1.0
  response.setDateHeader ("Expires", 0); //prevents caching at the proxy
server
%>

you have an error!<BR>

   <s:label name="age"            /><BR>  
   <s:label name="state"           /><BR>    
   <s:label name="registrationDate" /><BR>        


My question is this:
how can output only the fields that has error in it ???
in the example above the only error is in the age field; the state and
registrationDate are OK

thanks

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


Attachment: user_184669.ezm (zipped)

Hi everyone,

I'm new to struts 2, and I finally managed to link 2 autocompleters using a
few examples like this one:
http://www.planetstruts.org/struts2-showcase/viewSource.action?page=/ajax/autocompleter/index.jsp

or this one:

http://struts.apache.org/2.x/docs/autocompleter.html

As it is done in the example, the first list does not come from an action,
and we can get the value which is selected. The problem is: when the list is
made by an action, like this one:

<sx:autocompleter href="%{jsonList}" formId="selectForm"
listenTopics="/changed"/>

ok the list is made by the action and it works, but I really can't manage to
get the selected value from it.
I add name="anyVariableName", exactly the same way I do for the first
version, but the value is never taken, I can see it in the log file from my
application.

I hope I managed to write a clear question, and I hope, too, that someone
will be able to help me with this problem. I am sure it is not complicated,
but up to now I have not been able to find it by myself...

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

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