You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Chen Chunwei <ou...@cn.panasonic.com> on 2008/03/26 02:45:40 UTC

The validator does not work

Hi all,

It seems that my struts application's validator does not work. I've add 
 <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
  <set-property property="pathnames"
   value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml" />
 </plug-in>
to my struts-config.xml and these two files surely exist.

Actually, it did work yesterday and I don't remember there are any change applied to my application. But the validator just does not work.

Have you ever met with this situation? Or is there any way to find out the reason why the validator doesn't work? I can debug my application.

Thanks.

Talos

Re: Use of ExtJS

Posted by Dave Newton <ne...@yahoo.com>.
--- Martin Gainty <mg...@hotmail.com> wrote:
> 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="<@s.url value='/struts/ajax/dojoRequire.js'
> 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


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Use of ExtJS

Posted by Martin Gainty <mg...@hotmail.com>.
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="<@s.url value='/struts/ajax/dojoRequire.js'
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" <fr...@meruvian.org>
To: "Struts Users Mailing List" <us...@struts.apache.org>
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
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Use of ExtJS

Posted by Frans Thamura <fr...@meruvian.org>.
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

Re: Use of ExtJS

Posted by Alvaro Sanchez-Mariscal <al...@gmail.com>.
>  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@gmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: How to use in your own java file?

Posted by Chen Chunwei <ou...@cn.panasonic.com>.
Thanks Antonio

I will try it.

Talos

----- Original Message ----- 
From: "Antonio Petrelli" <an...@gmail.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Thursday, March 27, 2008 4:23 PM
Subject: Re: How to use <data-source> in your own java file?


2008/3/27, Chen Chunwei <ou...@cn.panasonic.com>:
>  I've already configured a <data-source> in struts-config.xml through some reference. But I don't know how to use it in my own business logic.

Use the "getDataSource" method in your action. Anyway, notice that it
is discouraged to use a data source this way. It is better to use JNDI
to take it from the container.

Antonio

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org

Re: How to use in your own java file?

Posted by Antonio Petrelli <an...@gmail.com>.
2008/3/27, Chen Chunwei <ou...@cn.panasonic.com>:
>  I've already configured a <data-source> in struts-config.xml through some reference. But I don't know how to use it in my own business logic.

Use the "getDataSource" method in your action. Anyway, notice that it
is discouraged to use a data source this way. It is better to use JNDI
to take it from the container.

Antonio

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


How to use in your own java file?

Posted by Chen Chunwei <ou...@cn.panasonic.com>.
Hi all,

I've already configured a <data-source> in struts-config.xml through some reference. But I don't know how to use it in my own business logic.

Talos

Re: How to enable the client side validation?

Posted by Antonio Petrelli <an...@gmail.com>.
2008/3/26, Chen Chunwei <ou...@cn.panasonic.com>:
>
> 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?



Good catch. In fact, I think that the docs should be fixed, because also in
the draft docs there is no reference about it:
http://struts.apache.org/1.x/userGuide/building_view.html#validator

So feel free to open an issue (and provide a patch, if you can :-) ):
https://issues.apache.org/struts/browse/STR

Antonio

Re: Help on

Posted by Chen Chunwei <ou...@cn.panasonic.com>.
I'm using struts 1.1

----- Original Message ----- 
From: "Vinny" <xa...@gmail.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Tuesday, April 01, 2008 2:52 PM
Subject: Re: Help on <data-source>


What version of struts?
Data-source got deprecated at some point. I forget the version.



On 4/1/08, Chen Chunwei <ou...@cn.panasonic.com> wrote:
> Hi all,
>
> I've configured a data source at struts-config.xml. This data source use
> oracle thin jdbc driver. And I've already included the ojdbc.jar. Also, the
> oracle database I'm trying to connect is OK. But I just can't make the data
> source get the connection. It always throws a SQLException: Timeout awaiting
> connection. Can anyone give some help? Following is my <data-source>.
> ----------------------------------------------------------------------------------------------
>   <data-source key="org.apache.struts.action.DATA_SOURCE">
>    <set-property property="password" value="passw0rd" />
>    <set-property property="minCount" value="" />
>    <set-property property="maxCount" value="" />
>    <set-property property="user" value="planuser" />
>    <set-property property="driverClass"
>     value="oracle.jdbc.driver.OracleDriver" />
>    <set-property property="description"
>     value="Oracle 9i Database - Struts Test" />
>    <set-property property="url"
>     value="jdbc:oracle:thin:@10.192.225.8:1521:wpsprod" />
>    <set-property property="readOnly" value="false" />
>    <set-property property="autoCommit" value="false" />
>    <set-property property="loginTimeout" value="30" />
>   </data-source>
> ----------------------------------------------------------------------------------------------
>
> Thanks
>
> Talos

-- 
Sent from Gmail for mobile | mobile.google.com

The future is here. It's just not widely distributed yet.
-William Gibson

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org

Re: Help on

Posted by Vinny <xa...@gmail.com>.
What version of struts?
Data-source got deprecated at some point. I forget the version.



On 4/1/08, Chen Chunwei <ou...@cn.panasonic.com> wrote:
> Hi all,
>
> I've configured a data source at struts-config.xml. This data source use
> oracle thin jdbc driver. And I've already included the ojdbc.jar. Also, the
> oracle database I'm trying to connect is OK. But I just can't make the data
> source get the connection. It always throws a SQLException: Timeout awaiting
> connection. Can anyone give some help? Following is my <data-source>.
> ----------------------------------------------------------------------------------------------
>   <data-source key="org.apache.struts.action.DATA_SOURCE">
>    <set-property property="password" value="passw0rd" />
>    <set-property property="minCount" value="" />
>    <set-property property="maxCount" value="" />
>    <set-property property="user" value="planuser" />
>    <set-property property="driverClass"
>     value="oracle.jdbc.driver.OracleDriver" />
>    <set-property property="description"
>     value="Oracle 9i Database - Struts Test" />
>    <set-property property="url"
>     value="jdbc:oracle:thin:@10.192.225.8:1521:wpsprod" />
>    <set-property property="readOnly" value="false" />
>    <set-property property="autoCommit" value="false" />
>    <set-property property="loginTimeout" value="30" />
>   </data-source>
> ----------------------------------------------------------------------------------------------
>
> Thanks
>
> Talos

-- 
Sent from Gmail for mobile | mobile.google.com

The future is here. It's just not widely distributed yet.
-William Gibson

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Help on

Posted by Antonio Petrelli <an...@gmail.com>.
2008/4/1, Chen Chunwei <ou...@cn.panasonic.com>:
>
> Personally, I do wanna use JNDI. But the project I'm going to do is based
> on struts 1.1 and using <data-source> to connect to db. So I have to learn
> on these things first and learn the advanced things later after work :-)



Notice that JNDI support depends on the container. Even Tomcat 4.1.xsupports it.

Antonio

Re: Help on

Posted by Chen Chunwei <ou...@cn.panasonic.com>.
Thanks

Personally, I do wanna use JNDI. But the project I'm going to do is based on struts 1.1 and using <data-source> to connect to db. So I have to learn on these things first and learn the advanced things later after work :-)

Talos

----- Original Message ----- 
From: "Antonio Petrelli" <an...@gmail.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Tuesday, April 01, 2008 3:54 PM
Subject: Re: Help on <data-source>


2008/4/1, Chen Chunwei <ou...@cn.panasonic.com>:
>
> By the way, can I say that, if I use <data-source> in my struts
> application, then the struts servlet manages the connection? That is, when
> the application is deployed, the struts servlet will automaticly create
> connections of numbers specified by "minCount". And the application just
> fetch the connection created to use?



It's not the servlet that manages the connections, but the data source, that
acts also as a connection pool. For more information, see:
http://commons.apache.org/dbcp/
This data source is created by the servlet.
The reason why it is deprecated is that it mixes the Controller and the
Model layers of the MVC model.

Antonio

Re: Help on

Posted by Antonio Petrelli <an...@gmail.com>.
2008/4/1, Chen Chunwei <ou...@cn.panasonic.com>:
>
> By the way, can I say that, if I use <data-source> in my struts
> application, then the struts servlet manages the connection? That is, when
> the application is deployed, the struts servlet will automaticly create
> connections of numbers specified by "minCount". And the application just
> fetch the connection created to use?



It's not the servlet that manages the connections, but the data source, that
acts also as a connection pool. For more information, see:
http://commons.apache.org/dbcp/
This data source is created by the servlet.
The reason why it is deprecated is that it mixes the Controller and the
Model layers of the MVC model.

Antonio

Re: Help on

Posted by Chen Chunwei <ou...@cn.panasonic.com>.
Thanks Antonio

Now I can make it connected. 

By the way, can I say that, if I use <data-source> in my struts application, then the struts servlet manages the connection? That is, when the application is deployed, the struts servlet will automaticly create connections of numbers specified by "minCount". And the application just fetch the connection created to use?

Talos

----- Original Message ----- 
From: "Antonio Petrelli" <an...@gmail.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Tuesday, April 01, 2008 3:27 PM
Subject: Re: Help on <data-source>


2008/4/1, Chen Chunwei <ou...@cn.panasonic.com>:
>
> java.sql.SQLException: Io Exception: The Network Adapter could not
> establish the connection



It seems that you cannot reach the Oracle server... can you ping it? Are you
able to see it through a sql client?

Antonio

Re: Help on

Posted by Antonio Petrelli <an...@gmail.com>.
2008/4/1, Chen Chunwei <ou...@cn.panasonic.com>:
>
> java.sql.SQLException: Io Exception: The Network Adapter could not
> establish the connection



It seems that you cannot reach the Oracle server... can you ping it? Are you
able to see it through a sql client?

Antonio

Re: Help on

Posted by Chen Chunwei <ou...@cn.panasonic.com>.
Here's the whole stacktrace. Note: the language version of my Tomcat 5.5 is Chinese. So I replaced some non-English text with translated English.

Talos
--------------------------------begin----------------------------------------------------------------

2008-4-1 15:07:22 org.apache.catalina.startup.HostConfig checkResources
Infomation: Reloading context [/Week 3 DbAccess]
2008-4-1 15:07:22 org.apache.struts.util.PropertyMessageResources <init>
Infomation: Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true
2008-4-1 15:07:22 org.apache.struts.util.PropertyMessageResources <init>
Infomation: Initializing, config='org.apache.struts.action.ActionResources', returnNull=true
2008-4-1 15:07:23 org.apache.struts.util.PropertyMessageResources <init>
Infomation: Initializing, config='com.psh.struts.ApplicationResources', returnNull=true
2008-4-1 15:07:23 org.apache.struts.legacy.GenericDataSource createConnection
Infomation:    createConnection()
2008-4-1 15:08:00 org.apache.struts.action.ActionServlet initModuleDataSources
Error: Initializing application data source org.apache.struts.action.DATA_SOURCE
java.sql.SQLException: Io Exception: The Network Adapter could not establish the connection
 at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
 at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
 at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:255)
 at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:387)
 at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:439)
 at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
 at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
 at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
 at org.apache.struts.legacy.GenericDataSource.createConnection(GenericDataSource.java:805)
 at org.apache.struts.legacy.GenericDataSource.open(GenericDataSource.java:741)
 at org.apache.struts.action.ActionServlet.initModuleDataSources(ActionServlet.java:1085)
 at org.apache.struts.action.ActionServlet.init(ActionServlet.java:472)
 at javax.servlet.GenericServlet.init(GenericServlet.java:212)
 at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1139)
 at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966)
 at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3956)
 at org.apache.catalina.core.StandardContext.start(StandardContext.java:4230)
 at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1116)
 at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1214)
 at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:293)
 at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
 at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1306)
 at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1570)
 at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1579)
 at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1559)
 at java.lang.Thread.run(Unknown Source)
2008-4-1 15:08:00 org.apache.catalina.core.ApplicationContext log
Infomation: Marking servlet action as unavailable
2008-4-1 15:08:00 org.apache.catalina.core.StandardContext loadOnStartup
Error: Servlet /Week 3 DbAccess threw load() exception
javax.servlet.UnavailableException: Initializing application data source org.apache.struts.action.DATA_SOURCE
 at org.apache.struts.action.ActionServlet.initModuleDataSources(ActionServlet.java:1091)
 at org.apache.struts.action.ActionServlet.init(ActionServlet.java:472)
 at javax.servlet.GenericServlet.init(GenericServlet.java:212)
 at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1139)
 at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966)
 at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3956)
 at org.apache.catalina.core.StandardContext.start(StandardContext.java:4230)
 at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1116)
 at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1214)
 at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:293)
 at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
 at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1306)
 at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1570)
 at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1579)
 at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1559)
 at java.lang.Thread.run(Unknown Source)
2008-4-1 15:11:10 org.apache.struts.util.PropertyMessageResources <init>
Infomation: Initializing, config='org.apache.struts.taglib.logic.LocalStrings', returnNull=true

------------------------------------end--------------------------------------------------------------------------


----- Original Message ----- 
From: "Antonio Petrelli" <an...@gmail.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Tuesday, April 01, 2008 3:13 PM
Subject: Re: Help on <data-source>


2008/4/1, Chen Chunwei <ou...@cn.panasonic.com>:
>
> Thanks.
>
> I've tried to specify minCount=2 and maxCount=4. But I've encountered a
> new exception: The Network Adapter could not establish the connection. Is
> that mean something wrong with my network connection?



Can I see the complete stacktrace?

Antonio

Re: Help on

Posted by Antonio Petrelli <an...@gmail.com>.
2008/4/1, Chen Chunwei <ou...@cn.panasonic.com>:
>
> Thanks.
>
> I've tried to specify minCount=2 and maxCount=4. But I've encountered a
> new exception: The Network Adapter could not establish the connection. Is
> that mean something wrong with my network connection?



Can I see the complete stacktrace?

Antonio

Re: Help on

Posted by Chen Chunwei <ou...@cn.panasonic.com>.
Thanks.

I've tried to specify minCount=2 and maxCount=4. But I've encountered a new exception: The Network Adapter could not establish the connection. Is that mean something wrong with my network connection?

I'm using Struts 1.1

Talos

----- Original Message ----- 
From: "Antonio Petrelli" <an...@gmail.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Tuesday, April 01, 2008 2:58 PM
Subject: Re: Help on <data-source>


Please Chen, the next time you post a question, say that you are using
Struts 1.1 *always*.
See the answers below.

2008/4/1, Chen Chunwei <ou...@cn.panasonic.com>:
>    <set-property property="minCount" value="" />
>    <set-property property="maxCount" value="" />

I think this is the problem: specify a value for "minCount" and "maxCount".
And remember to close the connection once you used it!
Notice that, for default, a commons-dbcp datasource will be used,
while I suggest to use the Oracle datasource.
And, BTW, as Vinny said, the datasource support in Struts is
deprecated, I suggest you to use JNDI and configure the datasource in
your container.

Antonio

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org

Re: Help on

Posted by Antonio Petrelli <an...@gmail.com>.
Please Chen, the next time you post a question, say that you are using
Struts 1.1 *always*.
See the answers below.

2008/4/1, Chen Chunwei <ou...@cn.panasonic.com>:
>    <set-property property="minCount" value="" />
>    <set-property property="maxCount" value="" />

I think this is the problem: specify a value for "minCount" and "maxCount".
And remember to close the connection once you used it!
Notice that, for default, a commons-dbcp datasource will be used,
while I suggest to use the Oracle datasource.
And, BTW, as Vinny said, the datasource support in Struts is
deprecated, I suggest you to use JNDI and configure the datasource in
your container.

Antonio

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Help on

Posted by Chen Chunwei <ou...@cn.panasonic.com>.
Hi all,

I've configured a data source at struts-config.xml. This data source use oracle thin jdbc driver. And I've already included the ojdbc.jar. Also, the oracle database I'm trying to connect is OK. But I just can't make the data source get the connection. It always throws a SQLException: Timeout awaiting connection. Can anyone give some help? Following is my <data-source>.
----------------------------------------------------------------------------------------------
  <data-source key="org.apache.struts.action.DATA_SOURCE">
   <set-property property="password" value="passw0rd" />
   <set-property property="minCount" value="" />
   <set-property property="maxCount" value="" />
   <set-property property="user" value="planuser" />
   <set-property property="driverClass"
    value="oracle.jdbc.driver.OracleDriver" />
   <set-property property="description"
    value="Oracle 9i Database - Struts Test" />
   <set-property property="url"
    value="jdbc:oracle:thin:@10.192.225.8:1521:wpsprod" />
   <set-property property="readOnly" value="false" />
   <set-property property="autoCommit" value="false" />
   <set-property property="loginTimeout" value="30" />
  </data-source>
----------------------------------------------------------------------------------------------

Thanks

Talos

Re: How to enable the client side validation?

Posted by Chen Chunwei <ou...@cn.panasonic.com>.
Sorry for mis-typing.

>But I wonder know ...

should be 

But I wanna know...

Talos
----- Original Message ----- 
From: "Chen Chunwei" <ou...@cn.panasonic.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
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" <an...@gmail.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Wednesday, March 26, 2008 5:18 PM
Subject: Re: How to enable the client side validation?


2008/3/26, Chen Chunwei <ou...@cn.panasonic.com>:
>
> 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

Re: How to enable the client side validation?

Posted by Chen Chunwei <ou...@cn.panasonic.com>.
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" <an...@gmail.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Wednesday, March 26, 2008 5:18 PM
Subject: Re: How to enable the client side validation?


2008/3/26, Chen Chunwei <ou...@cn.panasonic.com>:
>
> 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

Re: How to enable the client side validation?

Posted by Antonio Petrelli <an...@gmail.com>.
2008/3/26, Chen Chunwei <ou...@cn.panasonic.com>:
>
> 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

Re: How to enable the client side validation?

Posted by Chen Chunwei <ou...@cn.panasonic.com>.
Well, the case is that the Javascript code was generated well, but it was not triggered.

Talos

----- Original Message ----- 
From: "Antonio Petrelli" <an...@gmail.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Wednesday, March 26, 2008 5:10 PM
Subject: Re: How to enable the client side validation?


2008/3/26, Chen Chunwei <ou...@cn.panasonic.com>:
>
> As I said, I've already used <html:javascript>. Of course, I've alse done
> the other stuff found in the document you refer to (offline version). But it
> does not work.



What exactly does not work? Give more details, for example, exceptions at
startup of the application, or the Javascript code is not generated, etc.

Antonio

Re: How to enable the client side validation?

Posted by Antonio Petrelli <an...@gmail.com>.
2008/3/26, Chen Chunwei <ou...@cn.panasonic.com>:
>
> As I said, I've already used <html:javascript>. Of course, I've alse done
> the other stuff found in the document you refer to (offline version). But it
> does not work.



What exactly does not work? Give more details, for example, exceptions at
startup of the application, or the Javascript code is not generated, etc.

Antonio

Re: How to enable the client side validation?

Posted by Chen Chunwei <ou...@cn.panasonic.com>.
Thanks Antonio

As I said, I've already used <html:javascript>. Of course, I've alse done the other stuff found in the document you refer to (offline version). But it does not work.

Can you give some more details of using client-side validation?

Talos

----- Original Message ----- 
From: "Antonio Petrelli" <an...@gmail.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Wednesday, March 26, 2008 4:56 PM
Subject: Re: How to enable the client side validation?


2008/3/26, Chen Chunwei <ou...@cn.panasonic.com>:
>
> My struts version is 1.1. And I tried to add <html:javascript
> formName="submitForm" /> in my jsp file which needs validation. But it seems
> not working.



See:
http://struts.apache.org/1.1/userGuide/building_view.html#validator

Antonio

Re: How to enable the client side validation?

Posted by Antonio Petrelli <an...@gmail.com>.
2008/3/26, Chen Chunwei <ou...@cn.panasonic.com>:
>
> My struts version is 1.1. And I tried to add <html:javascript
> formName="submitForm" /> in my jsp file which needs validation. But it seems
> not working.



See:
http://struts.apache.org/1.1/userGuide/building_view.html#validator

Antonio

Re: How to enable the client side validation?

Posted by Chen Chunwei <ou...@cn.panasonic.com>.
My struts version is 1.1. And I tried to add <html:javascript formName="submitForm" /> in my jsp file which needs validation. But it seems not working.

Talos

----- Original Message ----- 
From: "Nils-Helge Garli Hegvik" <ni...@gmail.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Wednesday, March 26, 2008 4:39 PM
Subject: Re: How to enable the client side validation?


http://struts.apache.org/2.x/docs/client-side-validation.html

Nils-H

On Wed, Mar 26, 2008 at 9:34 AM, Chen Chunwei
<ou...@cn.panasonic.com> wrote:
> Hi all,
>
>  just as title
>
>  Thanks.
>
>  Talos

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org

Re: How to enable the client side validation?

Posted by Nils-Helge Garli Hegvik <ni...@gmail.com>.
http://struts.apache.org/2.x/docs/client-side-validation.html

Nils-H

On Wed, Mar 26, 2008 at 9:34 AM, Chen Chunwei
<ou...@cn.panasonic.com> wrote:
> Hi all,
>
>  just as title
>
>  Thanks.
>
>  Talos

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


How to enable the client side validation?

Posted by Chen Chunwei <ou...@cn.panasonic.com>.
Hi all,

just as title

Thanks.

Talos

Use of ExtJS

Posted by Prashant Saraf <ps...@cctc.com>.
Hi,

Can we use ExtJS with Struts 2 Tags?

Regards,
Prashant.


Re: The validator does not work

Posted by Chen Chunwei <ou...@cn.panasonic.com>.
Finally I found the problem!

I did apply a slight change to the validator.xml yesterday: just added the following xml header.

<!DOCTYPE form-validation PUBLIC 
"-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.1//EN" 
"http://jakarta.apache.org/commons/dtds/validator_1_1.dtd">

But in the above header, the version of validator is declared as 1.1 while in my validator-rules.xml, the version is 1.0! So, obviously there is a version conflict which caused the validator did not work.

Talos


----- Original Message ----- 
From: "Chen Chunwei" <ou...@cn.panasonic.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Wednesday, March 26, 2008 9:45 AM
Subject: The validator does not work


Hi all,

It seems that my struts application's validator does not work. I've add 
 <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
  <set-property property="pathnames"
   value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml" />
 </plug-in>
to my struts-config.xml and these two files surely exist.

Actually, it did work yesterday and I don't remember there are any change applied to my application. But the validator just does not work.

Have you ever met with this situation? Or is there any way to find out the reason why the validator doesn't work? I can debug my application.

Thanks.

Talos