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/19 04:06:26 UTC

About ActionErrors.GLOBAL_ERROR

Hi all,

Can anyone tell me that the real value of constant ActionErrors.GLOBAL_ERROR? Or where to find it?
Actually, I want to use the tag <html:errors /> to only display the error defined with ActionErrors.GLOBAL_ERROR.

I have the struts javadoc api, but I cannot access the Internet.

Thanks.

Re: About ActionErrors.GLOBAL_ERROR

Posted by Antonio Petrelli <an...@gmail.com>.
2008/3/19, Chen Chunwei <ou...@cn.panasonic.com>:
> Hi all,
>
>  Can anyone tell me that the real value of constant ActionErrors.GLOBAL_ERROR? Or where to find it?
>  Actually, I want to use the tag <html:errors /> to only display the error defined with ActionErrors.GLOBAL_ERROR.

You don't need it! Read the taglibdoc:
http://struts.apache.org/1.3.8/struts-taglib/tlddoc/html/errors.html

At the "name" attribute, it says:
Name of the bean (in any scope) under which our error messages have
been stored. If not present, the name specified by the
Globals.ERROR_KEY constant string will be used.

HTH
Antonio

---------------------------------------------------------------------
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 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: About Message Icons

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

----- Original Message ----- 
From: "Chris Pratt" <th...@gmail.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Tuesday, March 25, 2008 2:01 PM
Subject: Re: About Message Icons


On Mon, Mar 24, 2008 at 10:58 PM, Chen Chunwei
<ou...@cn.panasonic.com> wrote:
> Maybe some pre-defined style of message display or something else.
>
>  I know I can do these all myself. But if there's already something can do this, why not just use it?
>

There are the <s:actionerror>, <s:actionmessage>, and <s:fielderror>
tags, but I don't believe they use any standard images.  You might
look into the theme support built into Struts2, you may be able to
define your own theme that includes the proper images in the above
tags.
  (*Chris*)

---------------------------------------------------------------------
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: 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>.
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


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


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: About Message Icons

Posted by Laurie Harper <la...@holoweb.net>.
Chris Pratt wrote:
> On Mon, Mar 24, 2008 at 10:58 PM, Chen Chunwei
> <ou...@cn.panasonic.com> wrote:
>> Maybe some pre-defined style of message display or something else.
>>
>>  I know I can do these all myself. But if there's already something can do this, why not just use it?
>>
> 
> There are the <s:actionerror>, <s:actionmessage>, and <s:fielderror>
> tags, but I don't believe they use any standard images.  You might
> look into the theme support built into Struts2, you may be able to
> define your own theme that includes the proper images in the above
> tags.
>   (*Chris*)

You could also use the cssClass/cssStyle/etc attributes with those tags 
rather than customizing the templates, though customizing the templates 
is probably easier if you aren't using the simple theme (and therefore 
aren't using those tags to render error messages yourself).

L.


---------------------------------------------------------------------
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 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

The validator does not work

Posted by Chen Chunwei <ou...@cn.panasonic.com>.
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: About Message Icons

Posted by Chris Pratt <th...@gmail.com>.
On Mon, Mar 24, 2008 at 10:58 PM, Chen Chunwei
<ou...@cn.panasonic.com> wrote:
> Maybe some pre-defined style of message display or something else.
>
>  I know I can do these all myself. But if there's already something can do this, why not just use it?
>

There are the <s:actionerror>, <s:actionmessage>, and <s:fielderror>
tags, but I don't believe they use any standard images.  You might
look into the theme support built into Struts2, you may be able to
define your own theme that includes the proper images in the above
tags.
  (*Chris*)

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


Re: About Message Icons

Posted by Chen Chunwei <ou...@cn.panasonic.com>.
Maybe some pre-defined style of message display or something else.

I know I can do these all myself. But if there's already something can do this, why not just use it?

----- Original Message ----- 
From: "Chris Pratt" <th...@gmail.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Tuesday, March 25, 2008 1:43 PM
Subject: Re: About Message Icons


On Mon, Mar 24, 2008 at 10:45 PM, Chen Chunwei
<ou...@cn.panasonic.com> wrote:
> Er... I mean custom tags for free.
>

What should this custom tag do that the free <img> tag doesn't do?
  (*Chris*)

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

Re: About Message Icons

Posted by Chris Pratt <th...@gmail.com>.
On Mon, Mar 24, 2008 at 10:45 PM, Chen Chunwei
<ou...@cn.panasonic.com> wrote:
> Er... I mean custom tags for free.
>

What should this custom tag do that the free <img> tag doesn't do?
  (*Chris*)

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


Re: About Message Icons

Posted by Chen Chunwei <ou...@cn.panasonic.com>.
Er... I mean custom tags for free.

----- Original Message ----- 
From: "Chris Pratt" <th...@gmail.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Tuesday, March 25, 2008 1:26 PM
Subject: Re: About Message Icons


On Mon, Mar 24, 2008 at 10:03 PM, Chen Chunwei
<ou...@cn.panasonic.com> wrote:
> Hi all,
>
>  Is there any tag can be used to display message icons? I mean icons like alert, error, info and etc.
>
>  Talos

<img src="images/alert.gif" />

  (*Chris*)

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

Re: About Message Icons

Posted by Chris Pratt <th...@gmail.com>.
On Mon, Mar 24, 2008 at 10:03 PM, Chen Chunwei
<ou...@cn.panasonic.com> wrote:
> Hi all,
>
>  Is there any tag can be used to display message icons? I mean icons like alert, error, info and etc.
>
>  Talos

<img src="images/alert.gif" />

  (*Chris*)

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


Re: About Message Icons

Posted by "Kropp, Henning" <hk...@microlution.de>.
Chen Chunwei schrieb:
> Hi all,
>
> Is there any tag can be used to display message icons? I mean icons like alert, error, info and etc.
>
> Talos
Appfuse has implemented it in a way I think is very nice. Might consider 
to check it out.

kropp

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


About Message Icons

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

Is there any tag can be used to display message icons? I mean icons like alert, error, info and etc.

Talos

Re: About ActionErrors.GLOBAL_ERROR

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

I found the problem.
Actually, the tag <html:errors /> can display any ActionError found. But I confused my ApplicationResources.properties file, that is, the error I want to display was not defined in that file. So it will never be displayed until being defined.

Further more, I don't need to know the actual value of ActionErrors.GLOBAL_ERROR. Because I can just use it also in my jsp file. To do this, just add a line with <jsp:directive.page import="org.apache.struts.action.ActionErrors"/> in the header of the jsp file. Then I can use the expression <%=ActionErrors.GLOBAL_ERROR %> to get the value of ActionErrors.GLOBAL_ERROR.

I knew this is simple but I'm new to both JSP and STRUTS.

Talos


----- Original Message ----- 
From: "Lukasz Lenart" <lu...@googlemail.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Wednesday, March 19, 2008 3:16 PM
Subject: Re: About ActionErrors.GLOBAL_ERROR


Hi,

Maybe something like this:

<logic:messagesPresent name="<%=Globals.ERROR_KEY%>">
<table width="480" id="ErrorsTableId" class="ErrorsTable">
<html:messages id="error" name="<%=Globals.ERROR_KEY%>">
  <tr>
    <td><bean:write name="error" /></td>
  </tr>
</html:messages>
</table>
</logic:messagesPresent>

<logic:messagesPresent name="<%=Globals.MESSAGE_KEY%>">
<table width="480" id="MessagesTableId" class="MessagesTable">
<html:messages id="message" message="true">
  <tr>
    <td><bean:write name="message" /></td>
  </tr>
</html:messages>
</table>
</logic:messagesPresent>

<logic:present name="<%=Globals.EXCEPTION_KEY%>">
<table width="480" id="ExceptionTableId" style="display: none"
class="ExceptionTable">
  <html:messages id="exception" name="<%=Globals.EXCEPTION_KEY%>">
  <tr>
    <td>
      <bean:write name="exception" />
    </td>
  </tr>
  </html:messages>
</table>
</logic:present>


Regards
-- 
Lukasz

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

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

Re: About ActionErrors.GLOBAL_ERROR

Posted by Lukasz Lenart <lu...@googlemail.com>.
Hi,

Maybe something like this:

<logic:messagesPresent name="<%=Globals.ERROR_KEY%>">
<table width="480" id="ErrorsTableId" class="ErrorsTable">
<html:messages id="error" name="<%=Globals.ERROR_KEY%>">
  <tr>
    <td><bean:write name="error" /></td>
  </tr>
</html:messages>
</table>
</logic:messagesPresent>

<logic:messagesPresent name="<%=Globals.MESSAGE_KEY%>">
<table width="480" id="MessagesTableId" class="MessagesTable">
<html:messages id="message" message="true">
  <tr>
    <td><bean:write name="message" /></td>
  </tr>
</html:messages>
</table>
</logic:messagesPresent>

<logic:present name="<%=Globals.EXCEPTION_KEY%>">
<table width="480" id="ExceptionTableId" style="display: none"
class="ExceptionTable">
  <html:messages id="exception" name="<%=Globals.EXCEPTION_KEY%>">
  <tr>
    <td>
      <bean:write name="exception" />
    </td>
  </tr>
  </html:messages>
</table>
</logic:present>


Regards
-- 
Lukasz

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

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


Re: About ActionErrors.GLOBAL_ERROR

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

But I still don't know which value should I set for name property of <html:errors />, that is, which value should I fill xxx in <html:errors name="xxx" /> ?

Talos


----- Original Message ----- 
From: "David Chapman" <ri...@gmail.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Wednesday, March 19, 2008 11:36 AM
Subject: Re: About ActionErrors.GLOBAL_ERROR


My first reply to mailing list. Be gentle :) *

ActionErrors.GLOBAL_ERROR* is deprecated.

Use *ActionMessages.GLOBAL_MESSAGE* instead.

From ActionMessages.java ...

*public static final String GLOBAL_MESSAGE =
        "org.apache.struts.action.GLOBAL_MESSAGE";**
*
djc

On Tue, Mar 18, 2008 at 8:06 PM, Chen Chunwei <
out-chenchunwei@cn.panasonic.com> wrote:

> Hi all,
>
> Can anyone tell me that the real value of constant
> ActionErrors.GLOBAL_ERROR? Or where to find it?
> Actually, I want to use the tag <html:errors /> to only display the error
> defined with ActionErrors.GLOBAL_ERROR.
>
> I have the struts javadoc api, but I cannot access the Internet.
>
> Thanks.

Re: About ActionErrors.GLOBAL_ERROR

Posted by David Chapman <ri...@gmail.com>.
My first reply to mailing list. Be gentle :) *

ActionErrors.GLOBAL_ERROR* is deprecated.

Use *ActionMessages.GLOBAL_MESSAGE* instead.

>From ActionMessages.java ...

*public static final String GLOBAL_MESSAGE =
        "org.apache.struts.action.GLOBAL_MESSAGE";**
*
djc

On Tue, Mar 18, 2008 at 8:06 PM, Chen Chunwei <
out-chenchunwei@cn.panasonic.com> wrote:

> Hi all,
>
> Can anyone tell me that the real value of constant
> ActionErrors.GLOBAL_ERROR? Or where to find it?
> Actually, I want to use the tag <html:errors /> to only display the error
> defined with ActionErrors.GLOBAL_ERROR.
>
> I have the struts javadoc api, but I cannot access the Internet.
>
> Thanks.