Re: ajax - Submit a form

2007-05-21 Thread Mansour
NotifyTopics is not working. I don't know why, but I tried every 
possible thing. I can not understand what's wrong with this. The 
function showMessage() is called only once, when the page loads !! and 
nothing after that causes it to execute.  It's just a smiple message for 
testing:


script
function showMessage(){
   alert('test message!');
   }
/script

script type=text/javascript language=javascript
dojo.event.topic.subscribe(/saveData , showMessage() ) ;
/script

table
   tr
   tds:a href=javascript:// 
onclick=changeState(true);edit/s:a

   tds:url id=ajaxSubmit value=/updateAccount.action /s:url

   s:a theme=ajax href=%{ajaxSubmit} formId=MyData 
notifyTopics=/saveData  save /s:a

/td

   /tr
/table




Jeromy Evans wrote:


Depending on what your js function does, you may also be able to use 
the notifyTopics/listenTopics event mechanisms. Look at the example in 
Preventing a Request at  
http://struts.apache.org/2.x/docs/ajax-tags.html#AjaxTags-preventingRequest 



Otherwise try the handler= attribute to call your own js function 
before making the request yourself (I haven't tried this though and 
can't point to any examples)


Mansour wrote:
OK I found my problem. I shouldn't add onClick event to the anchor, 
but what do I do to execute a js function when this anchor is 
clicked. I tried using onMouseDown, but the same results.



Mansour wrote:
Thank you. That helped but still can not submit a form using an 
anchor out side that form. The fields are not populated in the action.


The code on the Site :

Using the anchor tag to submit a form:

s:form id=form1
 input type=textbox name=data   /s:form

s:url id=ajaxTest value=/AjaxTest.action /

s:a theme=ajax href=%{ajaxTest} formId=form1Submit form/s:a




My code:

s:head theme=ajax/s:head

table
tr

td
s:a href=javascript:// 
onclick=changeState(true);edit/s:a

td
s:url id=ajaxSubmit 
value=/updateAccount.action/s:url
s:a theme=ajax href=%{ajaxSubmit} formId=MyData 
onclick=changeState(false); save /s:a

/td
/tr
/table



table id=data_table
s:form id=MyData
tr
tds:label value=AccId: //td
tds:property value=acc.id / s:hidden name=acc.id
value=%{acc.id} id=acc.id //td
/tr

tr
tds:label value=First Name //td
tds:textfield name=acc.firstName disabled=true 
value=${acc.firstName} //td

/tr

/s:form
/table


That's not a big deal as I can move the anchors inside the form, but 
may be I am missing something here.





Jeromy Evans wrote:
Ensure you've included s:head theme=ajax to include the 
required javascript and try turning on ajax debugging (s:head 
theme=ajax debug=true).  Ensure the javascript exists in your 
html.

See the top of http://struts.apache.org/2.x/docs/ajax-tags.html

Mansour wrote:
I am populating some fields that can be edited and saved. Trying 
to do this using ajax. The action is getting called but the form 
is never submitted, and the updated data is lost.



table id=data_table 
s:form id=MyData action=updateAccount 
   tr
   td
   s:label value=AccId:  /
   /td
   td
   s:property value=acc.id/
   s:hidden name=acc.id value=%{acc.id} id=acc.id /
   /td
   /tr

   tr
   tds:label value=First Name  //td
   tds:textfield  name=acc.firstName  
value=${acc.firstName}   //td

   /tr
/td

/table

s:url id=ajaxSubmit value=/updateAccount.action /
s:a theme=ajax href=%{ajaxSubmit} formId=MyData save /s:a




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





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



RE: [S2] Freemarker vs struts taglibs

2007-05-21 Thread Jordi Rubio Moreno
Hi Musachy,

Thanks a lot for the response :)

Cheers! 


Jordi Rubio Moreno


-Mensaje original-
De: Musachy Barroso [mailto:[EMAIL PROTECTED] 
Enviado el: jueves, 17 de mayo de 2007 17:55
Para: Struts Users Mailing List
Asunto: Re: [S2] Freemarker vs struts taglibs

FreeMarker is a template engine, with it's own syntax. JSP tags can be
used in FreeMarker, adding some configuration. In the case of Struts
tags, no configuration is required, and you can use them like you would
in JSP except a few differences, see this for details:

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

musachy

On 5/17/07, Jordi Rubio Moreno [EMAIL PROTECTED] wrote:

 Hi,

 I'm a bit confused. I need to decide if I'll use Freemarker or Struts 
 taglibs, and I don't know the differences between both. E.g. what's 
 the difference between s:iterator and @s.iterator, s:url and 
 @s.url, etc etc...

 I have seen all the tutorials and examples I have found working with 
 taglibs, but people says WebWork and Struts 2's choice is
Freemarker...

 Please, help me to understand why taglibs or Freemarker :)

 Thanks a lot!

 Cheers!




--
Hey you! Would you help me to carry the stone? Pink Floyd

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



RE: Re: [S2] Understanding RestfulActionMapper and Restful2ActionMapper

2007-05-21 Thread Jordi Rubio Moreno
Hi Laurie,

Finally I'm working with DefaultActionMapper and wildcards:

Struts.properties:


struts.mapper.class=org.apache.struts2.dispatcher.mapper.DefaultActionMa
pper


struts.xml

action name=Search/*/* class=myproject.Search
interceptor-ref name=defaultStack/
param name=what{1}/param
param name=where{2}/param
result name=success/Results.jsp/result
result name=error/Error.jsp/result
/action   

and my friendly URLs looks like
http://localhost/app/Search/manager/london.action

Best regards!

Jordi Rubio Moreno
 

-Mensaje original-
De: news [mailto:[EMAIL PROTECTED] En nombre de Laurie Harper
Enviado el: martes, 15 de mayo de 2007 23:05
Para: user@struts.apache.org
Asunto: Re: [S2] Understanding RestfulActionMapper and
Restful2ActionMapper

I haven't used the restful mappers at all, so I'm just guessing, but it
may be that you need to use prefix mapping instead of suffix mapping in
web.xml.

Either way, if you are going to use suffix mapping, the suffix would
always be the last thing in the URL (not including any query part that
is). You could try these posibilities:

 http://localhost:8080/example/HelloWord/1.action
 http://localhost:8080/example/HelloWord/id/1.action

but I would think if you want restful URLs, switching to prefix mapping
and getting rid of the .action suffix would be what you want anyway...

L.

Jordi Rubio Moreno wrote:
 Hi,
  
 I'm testing HelloWorld struts 2 example with friendly url's. I have 
 read
  
 http://struts.apache.org/2.0.6/docs/restfulactionmapper.html
 http://struts.apache.org/2.0.6/struts2-core/apidocs/org/apache/struts2
 /d
 ispatcher/mapper/Restful2ActionMapper.htmlhttp://struts.apache.org/2.0
 .6
 /docs/restfulactionmapper.html
 (and a lot of pages found in Google speaking about Restful way)
  
 and I don't understand what I'm doing wrong.
  
 I have declared the HelloWord action as
  
 action name=HelloWorld/* class=example.HelloWorld
 param name=id{1}/param
 result/HelloWorld.jsp/result
 /action
  
 using wildcards to pass parameters. The HelloWord class has an id
 member variable, with it's public getters and setters.
  
 The struts.properties has the next lines configurated:
  
  
 struts.mapper.class=org.apache.struts2.dispatcher.mapper.Restful2Actio
 nM
 apper
 struts.action.extension=action
 struts.enable.DynamicMethodInvocation = false
 struts.enable.SlashesInActionNames = true
  
 (I have tested with RestfulActionMapper and DefaultActionMapper 
 objects
 too)
  
 I have read all documentation sections that speak about URL syntax 
 (http://HOST/ACTION_NAME/PARAM_NAME1/PARAM_VALUE1/PARAM_NAME2/PARAM_VA
 LU E2, etc etc), but my example doesn't works. I have tried this
 combinations:
  
 
   http://localhost:8080/example/HelloWord.action/1
   
   http://localhost:8080/example/HelloWord.action/id/1
   
   http://localhost:8080/example/id/1/HelloWord.action
   
   http://localhost:8080/example/1/HelloWord.action

 
 always with the same result: There is no Action mapped for action name

 blablabla/blablabla
  
 Please, I need to understand what I'm doing wrong, because I believe 
 I'm doing the things as tutorials and articles show, but without right

 results...
  
 Thanks a lot!
  
 Jordi Rubio Moreno
  
  
 


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


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



Re: How to get Exception info when I use global exception mappings?

2007-05-21 Thread Roger Varley


Thanks for your help, I got it.



As an aside, it may be worth pointing out that exposing your users to
a detailed StackTrace is not usually considered to be a good idea.
Firstly, a stack trace means nothing to your users and may actually
intimidate them, and secondly, if your application is web facing (as
opposed to an intranet) then you are probably revealing too much
information about your system and it's set up.

Regards
Roger

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



RE: [OT] Re: frames

2007-05-21 Thread Al Sutton
You can find lots of useful links about struts and frames at this URL;

http://www.google.co.uk/search?q=struts+frames
 

-Original Message-
From: jalal udeen [mailto:[EMAIL PROTECTED] 
Sent: 21 May 2007 05:57
To: Struts Users Mailing List
Subject: Re: [OT] Re: frames

hi
   im using struts 1.2.7 how can i frames using struts tag in jsp

thanks
jalal


On 5/19/07, Mansour [EMAIL PROTECTED] wrote:

 jalal udeen:
 We need more info to be able to help. What version of struts are you 
 using. If you you are using struts 2, then you can use the target 
 attribute in the same way you use html. So, in your form tag you need 
 to use the attribute target like this:

 s:form action=someAction method=post target=bodyFrame .. 
 /s:form

 for more info about this check the reference.

 http://struts.apache.org/2.x/docs/tag-reference.html




 Dave Newton wrote:
  --- jalal udeen [EMAIL PROTECTED] wrote:
 
  how  can i use frame using struts in jsp its an urgent requirement
 
 
  I am most definitely *not* speaking for everyone on the newsgroup, 
  but I really think you need to explore other options for asking 
  non-Struts related questions.
 
  If you want to pay me for doing your work I will consider a 
  sub-contracting position, although I am fairly busy of late and am 
  relatively expensive.
 
  Others on the list will probably be much nicer than I am, and more 
  helpful, but there's a point at which the OT stuff needs to go 
  somewhere else.
 
  Sorry,
  Dave
 
 
 
 
 
 __
 __You snooze, you lose. Get messages ASAP with AutoCheck
  in the all-new Yahoo! Mail Beta.
  http://advision.webevents.yahoo.com/mailbeta/newmail_html.html
 
  
  - To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 


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




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



Re: showcase file download in jetty server

2007-05-21 Thread sudeepj2ee

HI I have got the solution posted on the forum. just change the'\' slashes to
'/'slashes.:)

sudeepj2ee wrote:
 
 HI
 
 I am using jetty server and the zip file download part of showcase is not
 working in the jetty its giving the following error-:
 
 java.lang.IllegalArgumentException: Can not find a java.io.InputStream
 with the name [inputStream] in the invocation stack. Check the  tag
 specified for this action.
   at
 org.apache.struts2.dispatcher.StreamResult.doExecute(StreamResult.java:189)
   at
 org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:178)
   at
 com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:343)
   at
 com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
   at
 com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:213)
   at
 com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
   at
 com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:219)
   at
 com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:218)
   at
 com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
   at
 com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:216)
   at
 com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:150)
   at
 org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:48)
   at
 com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
   at
 com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:219)
   at
 com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:218)
   at
 com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
   at
 com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:216)
   at
 com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:123)
   at
 com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:219)
   at
 com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:218)
   at
 com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
   at
 com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:216)
   at
 com.opensymphony.xwork2.interceptor.ParametersInterceptor.intercept(ParametersInterceptor.java:161)
   at
 com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:219)
   at
 com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:218)
   at
 com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
   at
 com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:216)
   at
 com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:105)
   at
 com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:219)
   at
 com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:218)
   at
 com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
   at
 com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:216)
   at
 org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:83)
   at
 com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:219)
   at
 com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:218)
   at
 com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
   at
 com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:216)
   at
 org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:207)
   at
 com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:219)
   at
 com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:218)
   at
 com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
   at
 com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:216)
   at
 com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:74)
   at
 

OT- need some help

2007-05-21 Thread vikas rao

Hi,

Can someone point out a tutorial or some place where I can learn how to read
values from a .cfg file?
Say I have a Input.cfg file which goes like:
com
MyCompany
  Common
inputDir=C:/vray/xml_files/
 outputDir=C:/xm_output
  /
/MyCompany
/com

Now, if I need the inputDir value inside my program, how do I do it?

Sorry that this is off topic from struts, but i cant seem to find some
sensible help.

Any help will be appreciated.
Thanks.
Vikas.


Re: OT- need some help

2007-05-21 Thread Martin Kindler

Seems like you are looking for some type of XML reading.
I would propose to look at Digester (which stems from  the Struts 
project originally) (http://jakarta.apache.org/commons/digester/)
or Betwixt (also from Apache Jakarta Commons 
http://jakarta.apache.org/commons/betwixt/) which builds on Digester and 
as an add-on allows you to write Java beans to an XML file.


Both are fairly easy to use and if your application is Struts based you 
should already have Digester included.


Tutorials and docs can be found on the Jakarta Commons site.

Martin

vikas rao schrieb:

Hi,

Can someone point out a tutorial or some place where I can learn how to 
read

values from a .cfg file?
Say I have a Input.cfg file which goes like:
com
MyCompany
  Common
inputDir=C:/vray/xml_files/
 outputDir=C:/xm_output
  /
/MyCompany
/com

Now, if I need the inputDir value inside my program, how do I do it?

Sorry that this is off topic from struts, but i cant seem to find some
sensible help.

Any help will be appreciated.
Thanks.
Vikas.




--
--
Martin Kindler
Kaulbachstr. 20a
D-12247 Berlin
Deutschland

E-Mail: [EMAIL PROTECTED]
Tel. +49 (030) 260 78 48 1
Fax  +49 (030) 260 78 48 3
GSM  +49 (0160) 977 636 14
Skype martin.kindler

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



Re: OT- need some help

2007-05-21 Thread MK Tan

Hi,

Just wonder why you need to do this in xml way?
Wasn't it much simpler if you do it in properties (key value) format?
Most of the time, I just found it people like to overuse xml :-p

Best regards,
MK Tan

On 5/21/07, vikas rao [EMAIL PROTECTED] wrote:


Hi,

Can someone point out a tutorial or some place where I can learn how to
read
values from a .cfg file?
Say I have a Input.cfg file which goes like:
com
MyCompany
   Common
 inputDir=C:/vray/xml_files/
  outputDir=C:/xm_output
   /
/MyCompany
/com

Now, if I need the inputDir value inside my program, how do I do it?

Sorry that this is off topic from struts, but i cant seem to find some
sensible help.

Any help will be appreciated.
Thanks.
Vikas.



Re: OT- need some help

2007-05-21 Thread vikas rao

Can you give me an example?
The reason I chose to do it this way is basically I can change the
inputDirectory, outputdirectory and other values without making any changes
in the code, hence using it anywhere becomes easy.
In our company, we have a jar file which is included in the build path and
then we access the config files like:
Config configRoot = ConfigFactory.create(ConfigFactory.DEFAULT);
and then using the Config object, go onto access the values in the .cfg
files...but If i want to use this elsewhere, how would i do a similar thing?
That was my question.

Thanks.
Vikas.

On 5/21/07, MK Tan [EMAIL PROTECTED] wrote:


Hi,

Just wonder why you need to do this in xml way?
Wasn't it much simpler if you do it in properties (key value) format?
Most of the time, I just found it people like to overuse xml :-p

Best regards,
MK Tan

On 5/21/07, vikas rao [EMAIL PROTECTED] wrote:

 Hi,

 Can someone point out a tutorial or some place where I can learn how to
 read
 values from a .cfg file?
 Say I have a Input.cfg file which goes like:
 com
 MyCompany
Common
  inputDir=C:/vray/xml_files/
   outputDir=C:/xm_output
/
 /MyCompany
 /com

 Now, if I need the inputDir value inside my program, how do I do it?

 Sorry that this is off topic from struts, but i cant seem to find some
 sensible help.

 Any help will be appreciated.
 Thanks.
 Vikas.




Re: OT- need some help

2007-05-21 Thread vikas rao

No, Martin,  I wasnt looking at plain xml reading ,in that case i could just
use a normal parser and get the values right?
Thanks,
Vikas.

On 5/21/07, vikas rao [EMAIL PROTECTED] wrote:


 Hi,

Can someone point out a tutorial or some place where I can learn how to
read values from a .cfg file?
Say I have a Input.cfg file which goes like:
com
 MyCompany
   Common
 inputDir=C:/vray/xml_files/
  outputDir=C:/xm_output
   /
/MyCompany
/com

Now, if I need the inputDir value inside my program, how do I do it?

Sorry that this is off topic from struts, but i cant seem to find some
sensible help.

Any help will be appreciated.
Thanks.
Vikas.



Connection Pooling

2007-05-21 Thread Balazs Michnay
Hi there,

This post might not be struts-related, but I read so many posts on this issue, 
that I thought I might ask...
Having read all the posts, I still cannot estabilish database connection using 
connection pooling.
I think I made all the settings I need, but still nothing...
1) I have a context tag in my server.xml
2) I used the following source code to connect:



1.Context ctx = new InitialContext();
2.if(ctx == null )  throw new Exception(No Context);
3.
4.Context envCtx = (Context) ctx.lookup(java:comp/env);   
 
5.DataSource ds = (DataSource) envCtx.lookup(jdbc/akr_db);
6.
7.if (ds != null) {
8.Connection conn = ds.getConnection();
9.
10.if(conn != null)  {
.   . .


I can get the datasource (5th line), but I cannot get connection (8th line). It 
exits with the following error message, however, I have set both the driver 
class name and url in my server.xml:

org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of 
class '' for connect URL 'null'

Any ideas what's next?

Thanks a lot,

  BM



 

Food fight? Enjoy some healthy debate 
in the Yahoo! Answers Food  Drink QA.
http://answers.yahoo.com/dir/?link=listsid=396545367

Re: OT- need some help

2007-05-21 Thread Martin Kindler

vikas rao schrieb:
No, Martin,  I wasnt looking at plain xml reading ,in that case i could 
just

use a normal parser and get the values right?
Thanks,
Vikas.
Yes, sure, you could just use an XML parser and do your own stuff. The 
problem with this approach would be that changing your XML structure 
would probably mean changing a lot of the processing.


This type of processing is handled by Digester which was originally made 
to deal with Struts config files. It will (called at an appropriate time 
in your app's lifecycle) convert your configuration information into 
(one or several) Java beans which your application can access. Seems for 
me exactly the thing you are looking for.


The other question is whether this machinery is worthwhile, if you are 
just having a few key-value pairs which probably would be easier be put 
into some plain text file (e. g a .properties file).


To give you an example how I do configuration in my Struts (1.x) based apps:
I introduce a plugin where I pass the path of the config-file as a 
parameter in struts-config.xml.
In the init-method of the plugin I use digester to transfer the 
information from my config file into a configuration bean which is put 
into application scope. From there it can be accessed when needed.


Martin



On 5/21/07, vikas rao [EMAIL PROTECTED] wrote:


 Hi,

Can someone point out a tutorial or some place where I can learn how to
read values from a .cfg file?
Say I have a Input.cfg file which goes like:
com
 MyCompany
   Common
 inputDir=C:/vray/xml_files/
  outputDir=C:/xm_output
   /
/MyCompany
/com

Now, if I need the inputDir value inside my program, how do I do it?

Sorry that this is off topic from struts, but i cant seem to find some
sensible help.

Any help will be appreciated.
Thanks.
Vikas.






--
--
Martin Kindler
Kaulbachstr. 20a
D-12247 Berlin
Deutschland

E-Mail: [EMAIL PROTECTED]
Tel. +49 (030) 260 78 48 1
Fax  +49 (030) 260 78 48 3
GSM  +49 (0160) 977 636 14
Skype martin.kindler

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



Re: OT- need some help

2007-05-21 Thread MK Tan

On 5/21/07, vikas rao [EMAIL PROTECTED] wrote:


Can you give me an example?





The reason I chose to do it this way is basically I can change the

inputDirectory, outputdirectory and other values without making any
changes
in the code, hence using it anywhere becomes easy.
In our company, we have a jar file which is included in the build path and
then we access the config files like:
Config configRoot = ConfigFactory.create(ConfigFactory.DEFAULT);
and then using the Config object, go onto access the values in the .cfg
files...but If i want to use this elsewhere, how would i do a similar
thing?



As long as your jar file and the cfg file are under the same classpath,
it shouldn't be any problem to read the value.

That was my question.


Thanks.
Vikas.

On 5/21/07, MK Tan [EMAIL PROTECTED] wrote:

 Hi,

 Just wonder why you need to do this in xml way?
 Wasn't it much simpler if you do it in properties (key value) format?
 Most of the time, I just found it people like to overuse xml :-p

 Best regards,
 MK Tan

 On 5/21/07, vikas rao [EMAIL PROTECTED] wrote:
 
  Hi,
 
  Can someone point out a tutorial or some place where I can learn how
to
  read
  values from a .cfg file?
  Say I have a Input.cfg file which goes like:
  com
  MyCompany
 Common
   inputDir=C:/vray/xml_files/
outputDir=C:/xm_output
 /
  /MyCompany
  /com
 
  Now, if I need the inputDir value inside my program, how do I do it?
 
  Sorry that this is off topic from struts, but i cant seem to find some
  sensible help.
 
  Any help will be appreciated.
  Thanks.
  Vikas.
 




Re: OT- need some help

2007-05-21 Thread vikas rao

Hi martin,
Yes, Now that I look at Digester's faq, seems like this can be pretty
useful.Once the info in the files are available through java beans, i can
use them anywhere I want using the getter methods.
However, in my current scenario, looks like a simple key value pair, ie
having a .properties file would suit me better.
   public static ResourceBundle confBundle = ResourceBundle.getBundle(package
name);

   public static String getPropValue(String key){
   String propValue = null;
   propValue = confBundle.getString(key);
   return propValue;
   }
}
And i could call getPropValue to access the value stored in the .properties
file right?
However, tonight is going to be spent on learning digester:)

Thanks,
Vikas.


On 5/21/07, Martin Kindler [EMAIL PROTECTED] wrote:


vikas rao schrieb:
 No, Martin,  I wasnt looking at plain xml reading ,in that case i could
 just
 use a normal parser and get the values right?
 Thanks,
 Vikas.
Yes, sure, you could just use an XML parser and do your own stuff. The
problem with this approach would be that changing your XML structure
would probably mean changing a lot of the processing.

This type of processing is handled by Digester which was originally made
to deal with Struts config files. It will (called at an appropriate time
in your app's lifecycle) convert your configuration information into
(one or several) Java beans which your application can access. Seems for
me exactly the thing you are looking for.

The other question is whether this machinery is worthwhile, if you are
just having a few key-value pairs which probably would be easier be put
into some plain text file (e. g a .properties file).

To give you an example how I do configuration in my Struts (1.x) based
apps:
I introduce a plugin where I pass the path of the config-file as a
parameter in struts-config.xml.
In the init-method of the plugin I use digester to transfer the
information from my config file into a configuration bean which is put
into application scope. From there it can be accessed when needed.

Martin


 On 5/21/07, vikas rao [EMAIL PROTECTED] wrote:

  Hi,

 Can someone point out a tutorial or some place where I can learn how to
 read values from a .cfg file?
 Say I have a Input.cfg file which goes like:
 com
  MyCompany
Common
  inputDir=C:/vray/xml_files/
   outputDir=C:/xm_output
/
 /MyCompany
 /com

 Now, if I need the inputDir value inside my program, how do I do it?

 Sorry that this is off topic from struts, but i cant seem to find some
 sensible help.

 Any help will be appreciated.
 Thanks.
 Vikas.




--
--
Martin Kindler
Kaulbachstr. 20a
D-12247 Berlin
Deutschland

E-Mail: [EMAIL PROTECTED]
Tel. +49 (030) 260 78 48 1
Fax  +49 (030) 260 78 48 3
GSM  +49 (0160) 977 636 14
Skype martin.kindler

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




[OT] how do i know servlet.jar verison i have?

2007-05-21 Thread אלחנן מעין

hi...

in my lib folder of an ear i've found a 'mystery' servlet.jar which has the 
size (76,877 kb) ,  i tried looking into manifest.mf but it says nothing 
about the version  only:


Manifest-Version: 1.0
Created-By: Ant 1.4

how do i know which version it is?
(it causes problems with our jsp compliation based on custom tags).

_
Express yourself instantly with MSN Messenger! Download today it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/



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



Re: [OT] how do i know servlet.jar verison i have?

2007-05-21 Thread Antonio Petrelli

2007/5/21, אלחנן מעין [EMAIL PROTECTED]:


hi...

in my lib folder of an ear i've found a 'mystery' servlet.jar which has
the
size (76,877 kb) ,  i tried looking into manifest.mf but it says nothing
about the version  only:

Manifest-Version: 1.0
Created-By: Ant 1.4

how do i know which version it is?


(it causes problems with our jsp compliation based on custom tags).



It should not be there! You have to use the one that comes with your servlet
container!
My suggestion is to remove it completely from the ear.

Antonio


[OT] why hasn't apache foundation voted for JSR-277?

2007-05-21 Thread אלחנן מעין

by searching for solutions for jar problems i had i came across this
http://jcp.org/en/jsr/results?id=3238

and wondered has anyone from apache gave this thought?

_
Don't just search. Find. Check out the new MSN Search! 
http://search.msn.click-url.com/go/onm00200636ave/direct/01/



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



[S2] Validation on datetimepicker

2007-05-21 Thread Julien Leonard

Hello all,

I'm using a datetimepicker in a search form, the result of the form is
displayed in a s:div (thanks theme=ajax on s:submit ).
My problem is, when the user set a wrong value in the datetimepicker (
toto), the s:div is updated but with the error page. In fact it's another
form with a header etc...

How can I validate the date to have the error message on the first form?

Julien


[S2] HTTP Status 404 - result 'null' not found

2007-05-21 Thread SvetlanaR

I am sure this issue is not new, and it must be a work around, but
unfortunately I was not able to find it yet. 
We have a local Windows environment (Sun App Server 8.2) where our project
works just fine. But once we deployed it on our server (Sun Solaris) we've
got the following error on every action we have in struts configuration xml. 
+ 
HTTP Status 404 - result 'null' not found 
type Status report 
message result 'null' not found 
description The requested resource (result 'null' not found) is not
available. 

 
Sun-Java-System/Application-Server 
++ 
After some checks of configurations on both servers (no major differences)
and included jars I replaced our project with one from the struts tutorial
HelloWorld.  http://struts.apache.org/2.0.6/docs/hello-world.html  
This project built in our environment had the same behavior as our oroginal
project - worked locally and got the 404 error on Solaris. 
It must be some parsing of struts config file issue. Struts can read the
action class, the method specified executes (checked in logs), but the
result page is not read (recognized) (???) 

I think it's a major problem and hope that the solution can be found. 

-- 
View this message in context: 
http://www.nabble.com/-S2--HTTP-Status-404---result-%27null%27-not-found-tf3790310.html#a10718987
Sent from the Struts - User mailing list archive at Nabble.com.


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



struts1 and struts2

2007-05-21 Thread xiaojie han
I am new to struts. 
There is struts1 and struts2. what are the differences between them?
Thanks.


   
Yahoo!
 oneSearch: Finally, mobile search 
that gives answers, not web links. 
http://mobile.yahoo.com/mobileweb/onesearch?refer=1ONXIC

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



Re: struts1 and struts2

2007-05-21 Thread Dave Newton
--- xiaojie han [EMAIL PROTECTED] wrote:
 There is struts1 and struts2. what are the
 differences between them?

http://struts.apache.org/2.x/docs/comparing-struts-1-and-2.html

d.



   
Pinpoint
 customers who are looking for what you sell. 
http://searchmarketing.yahoo.com/

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



Tiles and

2007-05-21 Thread Jim Theodoridis

Hello

I am having the follwoing definition at tiles-defs.xml

 definition name=.content.before.delete extends=.content
 put name=body   value=.cPanel.content.before.delete /
 put name=message   value=.msg.content.show /
 put name=toolbar   value={$1} /
 /definition

how can i set that toolbar definition will be null?
at tomcat 5.1.8 the put name=toolbar   value={$1} / works fine but 
at tomcat 5.5 i am getting an error like


The requested resource 
(/tera/tiles/layouts/templates/admin/blackplazza_admin/{$1}) is not 
available


i am using struts 1.2.9  tomcat 5.5.9


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



Re: Tiles and

2007-05-21 Thread Antonio Petrelli

2007/5/21, Jim Theodoridis [EMAIL PROTECTED]:


Hello

I am having the follwoing definition at tiles-defs.xml

  definition name=.content.before.delete extends=.content
  put name=body   value=.cPanel.content.before.delete /
  put name=message   value=.msg.content.show /
  put name=toolbar   value={$1} /
  /definition

how can i set that toolbar definition will be null?




What is that {$1}? I really cannot understand it.

Antonio


Re: [S2] Validation on datetimepicker

2007-05-21 Thread Musachy Barroso

You can use the notify topics to validate the date and cancel the request if
the date is not valid. On 2.0.6 I don't think there is any way to get Struts
do it for you. On 2.1 you can mix ajax with validation so any validation
supported by struts can be used with the ajax tags.

musachy

On 5/21/07, Julien Leonard [EMAIL PROTECTED] wrote:


Hello all,

I'm using a datetimepicker in a search form, the result of the form is
displayed in a s:div (thanks theme=ajax on s:submit ).
My problem is, when the user set a wrong value in the datetimepicker (
toto), the s:div is updated but with the error page. In fact it's
another
form with a header etc...

How can I validate the date to have the error message on the first form?

Julien





--
Hey you! Would you help me to carry the stone? Pink Floyd


Re: Tiles and

2007-05-21 Thread Jim Theodoridis

Antonio Petrelli wrote:

2007/5/21, Jim Theodoridis [EMAIL PROTECTED]:


Hello

I am having the follwoing definition at tiles-defs.xml

  definition name=.content.before.delete extends=.content
  put name=body   value=.cPanel.content.before.delete /
  put name=message   value=.msg.content.show /
  put name=toolbar   value={$1} /
  /definition

how can i set that toolbar definition will be null?




What is that {$1}? I really cannot understand it.

Antonio

I was just like null  and  i want something like  this 



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



Re: Tiles and

2007-05-21 Thread Antonio Petrelli

2007/5/21, Jim Theodoridis [EMAIL PROTECTED]:


Antonio Petrelli wrote:
 2007/5/21, Jim Theodoridis [EMAIL PROTECTED]:

 Hello

 I am having the follwoing definition at tiles-defs.xml

   definition name=.content.before.delete extends=.content
   put name=body   value=.cPanel.content.before.delete /
   put name=message   value=.msg.content.show /
   put name=toolbar   value={$1} /
   /definition

 how can i set that toolbar definition will be null?



 What is that {$1}? I really cannot understand it.




So you want to put a null value as an attribute?
If it has not been defined in .content definition, then you simply need to
remove the put element corresponding to the toolbar attribute.
If it already defined in .content, I think that you cannot do it in the
XML file, but you can still do it by adding a Tiles controller that will
remove that attribute value before rendering definition.

BTW, why do you want to put an attribute with a null value?

Antonio


Re: Tiles and

2007-05-21 Thread Jim Theodoridis

Because i allready have a template like this

 definition name=.mainLayout 
path=/tiles/layouts/templates/admin/blackplazza_admin/mainLayout.jsp

 put name=titlevalue= /
 put name=header   value=.header /
 put name=mainMenu 
value=/tiles/layouts/templates/admin/blackplazza_admin/mainMenu.jsp /

 put name=toolbar  value= /
 put name=message  value= /
 put name=body value= /
 put name=footer   value=/tiles/footers/admin/footer.jsp /
 /definition
...


 definition name=.content extends=.mainLayout
 put name=title  value=Äéá÷åßñçóç ¢ñèñùí /
 put name=toolbar   value=.toolbar.content /
 /definition

and i want the toolbar definition not to dispayed at .content.before.delete




Antonio Petrelli wrote:

2007/5/21, Jim Theodoridis [EMAIL PROTECTED]:


Antonio Petrelli wrote:
 2007/5/21, Jim Theodoridis [EMAIL PROTECTED]:

 Hello

 I am having the follwoing definition at tiles-defs.xml

   definition name=.content.before.delete extends=.content
   put name=body   value=.cPanel.content.before.delete /
   put name=message   value=.msg.content.show /
   put name=toolbar   value={$1} /
   /definition

 how can i set that toolbar definition will be null?



 What is that {$1}? I really cannot understand it.




So you want to put a null value as an attribute?
If it has not been defined in .content definition, then you simply 
need to

remove the put element corresponding to the toolbar attribute.
If it already defined in .content, I think that you cannot do it in the
XML file, but you can still do it by adding a Tiles controller that will
remove that attribute value before rendering definition.

BTW, why do you want to put an attribute with a null value?

Antonio





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



Re: Tiles and

2007-05-21 Thread Antonio Petrelli

2007/5/21, Jim Theodoridis [EMAIL PROTECTED]:


Because i allready have a template like this

  definition name=.mainLayout
path=/tiles/layouts/templates/admin/blackplazza_admin/mainLayout.jsp
  put name=titlevalue= /
  put name=header   value=.header /
  put name=mainMenu
value=/tiles/layouts/templates/admin/blackplazza_admin/mainMenu.jsp /
  put name=toolbar  value= /
  put name=message  value= /
  put name=body value= /
  put name=footer   value=/tiles/footers/admin/footer.jsp /
  /definition

...


  definition name=.content extends=.mainLayout
  put name=title  value=Διαχείρηση Άρθρων /
  put name=toolbar   value=.toolbar.content /
  /definition

and i want the toolbar definition not to dispayed at
.content.before.delete




I see, then  in tiles:insert, when you insert the toolbar attribute,
add:
ignore=true
This will skip the missing resource.

HTH
Antonio


Re: Tiles and

2007-05-21 Thread Jim Theodoridis

Thanx

Antonio Petrelli wrote:

2007/5/21, Jim Theodoridis [EMAIL PROTECTED]:


Because i allready have a template like this

  definition name=.mainLayout
path=/tiles/layouts/templates/admin/blackplazza_admin/mainLayout.jsp
  put name=titlevalue= /
  put name=header   value=.header /
  put name=mainMenu
value=/tiles/layouts/templates/admin/blackplazza_admin/mainMenu.jsp /
  put name=toolbar  value= /
  put name=message  value= /
  put name=body value= /
  put name=footer   
value=/tiles/footers/admin/footer.jsp /

  /definition

... 




  definition name=.content extends=.mainLayout
  put name=title  value=Διαχείρηση Άρθρων /
  put name=toolbar   value=.toolbar.content /
  /definition

and i want the toolbar definition not to dispayed at
.content.before.delete




I see, then  in tiles:insert, when you insert the toolbar attribute,
add:
ignore=true
This will skip the missing resource.

HTH
Antonio




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



[S2] Problem with ! notation

2007-05-21 Thread Roger Varley

Hi

I'm trying to call a method on my action using the ! notation as
explained in the CRUD demo. If I call my action from the browser bar
as http://localhost:8084/Tiger/StartOrder.action then the execute()
method runs. If I call
http://localhost:8084/Tiger/StartOrder!execute.action then I get the
Struts error page with the message There is no Action mapped for
namespace / and action name StartOrder!execute. - [unknown location]
(I've checked it with !Execute as well). I'm obviously missing
something 

Regards
Roger

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



Re: [S2] Problem with ! notation

2007-05-21 Thread Dave Newton
--- Roger Varley [EMAIL PROTECTED] wrote:
 I'm obviously missing something 

Is dynamic method invocation turned on?

(Hey dynamic method invocation... you sure are
looking good today, he cajoled, breathily.)

d.



 

Looking for earth-friendly autos? 
Browse Top Cars by Green Rating at Yahoo! Autos' Green Center.
http://autos.yahoo.com/green_center/

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



Re: [S2] Problem with ! notation

2007-05-21 Thread Roger Varley


Is dynamic method invocation turned on?

(Hey dynamic method invocation... you sure are
looking good today, he cajoled, breathily.)



It wasn't. I've changed the struts.properties file from
struts.enable.DynamicMethodInvocation = false to
struts.enable.DynamicMethodInvocation = true and restarted Tomcat but
no joy I'm afraid -
http://localhost:8084/Tiger/StartOrder!execute.action still gives me
the error message.

Regards
Roger

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



Re: [S2] Problem with ! notation

2007-05-21 Thread Dave Newton
--- Roger Varley [EMAIL PROTECTED] wrote:
 restarted Tomcat but no joy I'm afraid -

http://localhost:8084/Tiger/StartOrder!execute.action
 still gives me the error message.

You might have to post config snippets... I'm assuming
Tiger is the webapp?

d.



   
You
 snooze, you lose. Get messages ASAP with AutoCheck
in the all-new Yahoo! Mail Beta.
http://advision.webevents.yahoo.com/mailbeta/newmail_html.html

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



Re: [S2] Problem with ! notation

2007-05-21 Thread Roger Varley


You might have to post config snippets... I'm assuming
Tiger is the webapp?



Yes, Tiger is the webapp.

My struts.xml contains
action name=StartOrder
class=com.mysite.ecommerce.actions.StartOrderAction method=input
result/startOrder.jsp/result
/action

My struts.properties is located in WEB_INF/classes along with the
struts.xml file and contains
struts.devMode = true
struts.enable.DynamicMethodInvocation = true

If I call http://localhost:8084/Tiger/StartOrder.action then I can see
that the input() method is called on StartOrder.action through using
System.out.println(). However
http://localhost:8084/Tiger/StartOrder!input.action gives There is no
Action mapped for namespace / and action name StartOrder!input. -
[unknown location]

Is there anything else you need to see? I don't want to send too much
unneccassary data

Regards
Roger

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



Re: [S2] Problem with ! notation

2007-05-21 Thread Roger Varley

On 21/05/07, Roger Varley [EMAIL PROTECTED] wrote:


 You might have to post config snippets... I'm assuming
 Tiger is the webapp?



Dave

Forget the previous post - it's working after a fashion.
http://localhost:8084/Tiger/StartOrder.action runs OK and calls
StartOrder.input().
http://localhost:8084/Tiger/StartOrder!input.action runs OK and calls
StartOrder.input()
http://localhost:8084/Tiger/StartOrder!execute.action fails even
though I have an execute method.

Regards
Roger

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



submitting a form using java script on IE

2007-05-21 Thread Mansour
I need a table that contains anchors. Clicking on this anchors executes 
the Action I need. The table is working great in FF but not in IE. IE is 
getting the form object correctly put can not submit it. When I click on 
the anchor in IE, the page stays there and no action is taken. When I 
looked at the html source generated I found that s2 automatically sets 
the onSubmit attribute of the form. I am not sure if this has anything 
to do with IE not submitting the form.



display:table name=accounts id=row
   display:column title=ID
   s:form action=getAccountById method=post
   name=frm${row.id} id=frm${row.id} 
   s:a onclick=this.parentNode.submit();  href=javascript://
   c:out value=${row.firstName} /
   c:out value=${row.lastName} /
   /s:a
   s:hidden name=acc.id value=${row.id} /
   /s:form
   /display:column

the generated html looks like:

table id=row

thead
tr
thID/th
themail/th
thAddress/th
thPhone/th
thFax/th/tr/thead
tbody
tr class=odd
td

form id=frm39 name=frm39 onsubmit=return true; action=/fe/getAccountById.action 
method=post

a id=frm39_ href=javascript://  onclick=parentNode.submit(); John   
Smith   /a

input type=hidden name=acc.id value=39 id=frm39_acc_id/

/form

/td



Any Idea what's going on or what to do to fix this ?



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



RE: submitting a form using java script on IE

2007-05-21 Thread Forsberg, Mike
I've never used the this.parentNode.submit() in a form.  That might only
work in Firefox.  (I make no claim if this is true, as I didn't look it
up)

What I generally use is document.formName.submit().  

Hope I helped,

Mike

-Original Message-
From: Mansour [mailto:[EMAIL PROTECTED] 
Sent: Monday, May 21, 2007 12:22 PM
To: Struts Users Mailing List
Subject: submitting a form using java script on IE

I need a table that contains anchors. Clicking on this anchors executes 
the Action I need. The table is working great in FF but not in IE. IE is

getting the form object correctly put can not submit it. When I click on

the anchor in IE, the page stays there and no action is taken. When I 
looked at the html source generated I found that s2 automatically sets 
the onSubmit attribute of the form. I am not sure if this has anything 
to do with IE not submitting the form.


display:table name=accounts id=row
display:column title=ID
s:form action=getAccountById method=post
name=frm${row.id} id=frm${row.id} 
s:a onclick=this.parentNode.submit();
href=javascript://
c:out value=${row.firstName} /
c:out value=${row.lastName} /
/s:a
s:hidden name=acc.id value=${row.id} /
/s:form
/display:column

the generated html looks like:

table id=row

thead
tr
thID/th
themail/th
thAddress/th
thPhone/th
thFax/th/tr/thead
tbody
tr class=odd
td

form id=frm39 name=frm39 onsubmit=return true;
action=/fe/getAccountById.action method=post

a id=frm39_  href=javascript://  onclick=parentNode.submit();
JohnSmith   /a

input type=hidden name=acc.id value=39 id=frm39_acc_id/

/form

/td



Any Idea what's going on or what to do to fix this ?



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






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



Re: submitting a form using java script on IE

2007-05-21 Thread Mansour

Mike:
I tried this one too and I tried using getElementByID and I tried 
document.all[frmName], they all worked fine.  I was able to get the 
object successfully under FF and IE. I view the contents of this object 
using simple alerts and JS console in FF. The problem is when submitting 
the form the event doens't go through. S2 adds the attribute for the 
form (onSubmit=return true;) which is making things harder. It works 
fine when using buttons to submit but with anchors it's not . :/






Forsberg, Mike wrote:

I've never used the this.parentNode.submit() in a form.  That might only
work in Firefox.  (I make no claim if this is true, as I didn't look it
up)

What I generally use is document.formName.submit().  


Hope I helped,

Mike

-Original Message-
From: Mansour [mailto:[EMAIL PROTECTED] 
Sent: Monday, May 21, 2007 12:22 PM

To: Struts Users Mailing List
Subject: submitting a form using java script on IE

I need a table that contains anchors. Clicking on this anchors executes 
the Action I need. The table is working great in FF but not in IE. IE is


getting the form object correctly put can not submit it. When I click on

the anchor in IE, the page stays there and no action is taken. When I 
looked at the html source generated I found that s2 automatically sets 
the onSubmit attribute of the form. I am not sure if this has anything 
to do with IE not submitting the form.



display:table name=accounts id=row
display:column title=ID
s:form action=getAccountById method=post
name=frm${row.id} id=frm${row.id} 
s:a onclick=this.parentNode.submit();
href=javascript://
c:out value=${row.firstName} /
c:out value=${row.lastName} /
/s:a
s:hidden name=acc.id value=${row.id} /
/s:form
/display:column

the generated html looks like:

table id=row

thead
tr
thID/th
themail/th
thAddress/th
thPhone/th
thFax/th/tr/thead
tbody
tr class=odd
td

form id=frm39 name=frm39 onsubmit=return true;
action=/fe/getAccountById.action method=post

a id=frm39_ href=javascript://  onclick=parentNode.submit();
JohnSmith   /a

input type=hidden name=acc.id value=39 id=frm39_acc_id/

/form

/td



Any Idea what's going on or what to do to fix this ?



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






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


  



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



RE: submitting a form using java script on IE

2007-05-21 Thread Forsberg, Mike
From my understanding the onSubmit=return true; code just allows the
form to be submitted.  See
http://www.htmlcodetutorial.com/forms/_FORM_onSubmit.html


I noticed in your pasted output, the this is removed from the anchor
tags.  Could this be the issue?

Mike


-Original Message-
From: Mansour [mailto:[EMAIL PROTECTED] 
Sent: Monday, May 21, 2007 12:53 PM
To: Struts Users Mailing List
Subject: Re: submitting a form using java script on IE

Mike:
I tried this one too and I tried using getElementByID and I tried 
document.all[frmName], they all worked fine.  I was able to get the 
object successfully under FF and IE. I view the contents of this object 
using simple alerts and JS console in FF. The problem is when submitting

the form the event doens't go through. S2 adds the attribute for the 
form (onSubmit=return true;) which is making things harder. It works 
fine when using buttons to submit but with anchors it's not . :/





Forsberg, Mike wrote:
 I've never used the this.parentNode.submit() in a form.  That might
only
 work in Firefox.  (I make no claim if this is true, as I didn't look
it
 up)

 What I generally use is document.formName.submit().  

 Hope I helped,

 Mike

 -Original Message-
 From: Mansour [mailto:[EMAIL PROTECTED] 
 Sent: Monday, May 21, 2007 12:22 PM
 To: Struts Users Mailing List
 Subject: submitting a form using java script on IE

 I need a table that contains anchors. Clicking on this anchors
executes 
 the Action I need. The table is working great in FF but not in IE. IE
is

 getting the form object correctly put can not submit it. When I click
on

 the anchor in IE, the page stays there and no action is taken. When I 
 looked at the html source generated I found that s2 automatically sets

 the onSubmit attribute of the form. I am not sure if this has anything

 to do with IE not submitting the form.


 display:table name=accounts id=row
 display:column title=ID
 s:form action=getAccountById method=post
 name=frm${row.id} id=frm${row.id} 
 s:a onclick=this.parentNode.submit();
 href=javascript://
 c:out value=${row.firstName} /
 c:out value=${row.lastName} /
 /s:a
 s:hidden name=acc.id value=${row.id} /
 /s:form
 /display:column

 the generated html looks like:

 table id=row

 thead
 tr
 thID/th
 themail/th
 thAddress/th
 thPhone/th
 thFax/th/tr/thead
 tbody
 tr class=odd
 td
   
 form id=frm39 name=frm39 onsubmit=return true;
 action=/fe/getAccountById.action method=post

 a id=frm39_href=javascript://
onclick=parentNode.submit();
 John  Smith   /a

 input type=hidden name=acc.id value=39 id=frm39_acc_id/

 /form

 /td



 Any Idea what's going on or what to do to fix this ?



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






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


   


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






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



Re: submitting a form using java script on IE

2007-05-21 Thread Mansour
Sorry, that was my fault as I was reorganizing the code for the post. 
The keyword this was not taken off:


And I really don't think this is the issue.

table id=row
thead
tr
thID/th
themail/th
thAddress/th
thPhone/th
thFax/th/tr/thead
tbody
tr class=odd
td
  
form id=frm39 name=frm39 onsubmit=this.submit();; return true; 
action=/fe/getAccountById.action method=post


  a
   id=frm39_
   href=javascript://

onclick=this.parentNode.submit();

John Smith
  /a

  input type=hidden name=acc.id value=39 id=frm39_acc_id/

  /form






Forsberg, Mike wrote:

From my understanding the onSubmit=return true; code just allows the
form to be submitted.  See
http://www.htmlcodetutorial.com/forms/_FORM_onSubmit.html


I noticed in your pasted output, the this is removed from the anchor
tags.  Could this be the issue?

Mike


-Original Message-
From: Mansour [mailto:[EMAIL PROTECTED] 
Sent: Monday, May 21, 2007 12:53 PM

To: Struts Users Mailing List
Subject: Re: submitting a form using java script on IE

Mike:
I tried this one too and I tried using getElementByID and I tried 
document.all[frmName], they all worked fine.  I was able to get the 
object successfully under FF and IE. I view the contents of this object 
using simple alerts and JS console in FF. The problem is when submitting


the form the event doens't go through. S2 adds the attribute for the 
form (onSubmit=return true;) which is making things harder. It works 
fine when using buttons to submit but with anchors it's not . :/






Forsberg, Mike wrote:
  

I've never used the this.parentNode.submit() in a form.  That might


only
  

work in Firefox.  (I make no claim if this is true, as I didn't look


it
  

up)

What I generally use is document.formName.submit().  


Hope I helped,

Mike

-Original Message-
From: Mansour [mailto:[EMAIL PROTECTED] 
Sent: Monday, May 21, 2007 12:22 PM

To: Struts Users Mailing List
Subject: submitting a form using java script on IE

I need a table that contains anchors. Clicking on this anchors

executes 
  

the Action I need. The table is working great in FF but not in IE. IE


is
  

getting the form object correctly put can not submit it. When I click


on
  
the anchor in IE, the page stays there and no action is taken. When I 
looked at the html source generated I found that s2 automatically sets



  

the onSubmit attribute of the form. I am not sure if this has anything



  

to do with IE not submitting the form.


display:table name=accounts id=row
display:column title=ID
s:form action=getAccountById method=post
name=frm${row.id} id=frm${row.id} 
s:a onclick=this.parentNode.submit();
href=javascript://
c:out value=${row.firstName} /
c:out value=${row.lastName} /
/s:a
s:hidden name=acc.id value=${row.id} /
/s:form
/display:column

the generated html looks like:

table id=row

thead
tr
thID/th
themail/th
thAddress/th
thPhone/th
thFax/th/tr/thead
tbody
tr class=odd
td

form id=frm39 name=frm39 onsubmit=return true;
action=/fe/getAccountById.action method=post

a id=frm39_ href=javascript://


onclick=parentNode.submit();
  

JohnSmith   /a

input type=hidden name=acc.id value=39 id=frm39_acc_id/

/form

/td



Any Idea what's going on or what to do to fix this ?



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






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


  




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






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


  



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



Re: submitting a form using java script on IE

2007-05-21 Thread Mansour

It's working now.
It's my fault. The onclick function needs a return value:


s:form action=getAccountById method=post
  name=frm${row.id} id=frm${row.id}  
  s:a onclick=this.parentNode.submit();return false;  
href=javascript://

  c:out value=${row.firstName} /
  c:out value=${row.lastName} /
  /s:a
  s:hidden name=acc.id value=${row.id} /
 
  /s:form




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



[S2] Deploy error

2007-05-21 Thread laurosn

Hi all,

i'm developing an application using Struts 2 + Spring + Hibernate + Tiles 2.
I'm using the Jdeveloper 10.1.3 as the IDE. When i run the app inside the
IDE, everything works fine. But when i generate an EAR file and try to
deploy to server (OC4J or Tomcat), i receive the following message:

INFO - ContextLoader.initWebApplicationContext(174) | Root
WebApplicationContext
: initialization started
ERROR - ContextLoader.initWebApplicationContext(205) | Context
initialization fa
iled
java.lang.IllegalArgumentException: Name must not be null
at org.springframework.util.Assert.notNull(Assert.java:113)
at org.springframework.util.ClassUtils.forName(ClassUtils.java:162)
at org.springframework.util.ClassUtils.forName(ClassUtils.java:147)
at
org.springframework.web.context.ContextLoader.determineContextClass(C
ontextLoader.java:273)
at
org.springframework.web.context.ContextLoader.createWebApplicationCon
text(ContextLoader.java:230)
at
org.springframework.web.context.ContextLoader.initWebApplicationConte
xt(ContextLoader.java:184)
at
org.springframework.web.context.ContextLoaderListener.contextInitiali
zed(ContextLoaderListener.java:49)
at
org.apache.catalina.core.StandardContext.listenerStart(StandardContex
t.java:3827)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4
334)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase
.java:791)
at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:77


I also tried to put this in my web.xml (But here's another doubt: Why i have
to do this in web.xml for deploy and for running standalone not):

context-param
param-namecontextClass/param-name
   
param-valueorg.springframework.web.context.support.XmlWebApplicationContext/param-value
 /context-param

Then the stacktrace changes:

INFO - ContextLoader.initWebApplicationContext(174) | Root
WebApplicationContext
: initialization started
ERROR - ContextLoader.initWebApplicationContext(205) | Context
initialization fa
iled
org.springframework.beans.factory.BeanDefinitionStoreException: IOException
pars
ing XML document from ServletContext resource []; nested exception is
java.io.Fi
leNotFoundException: Could not open ServletContext resource []
Caused by:
java.io.FileNotFoundException: Could not open ServletContext resource []
at
org.springframework.web.context.support.ServletContextResource.getInp
utStream(ServletContextResource.java:99)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBea
nDefinitions(XmlBeanDefinitionReader.java:351)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBea
nDefinitions(XmlBeanDefinitionReader.java:334)
at
org.springframework.beans.factory.support.AbstractBeanDefinitionReade
r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:126)
at
org.springframework.beans.factory.support.AbstractBeanDefinitionReade
r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:142)
at
org.springframework.web.context.support.XmlWebApplicationContext.load
BeanDefinitions(XmlWebApplicationContext.java:123)
at
org.springframework.web.context.support.XmlWebApplicationContext.load
BeanDefinitions(XmlWebApplicationContext.java:91)
at
org.springframework.context.support.AbstractRefreshableApplicationCon
text.refreshBeanFactory(AbstractRefreshableApplicationContext.java:94)
at
org.springframework.context.support.AbstractApplicationContext.refres
h(AbstractApplicationContext.java:294)
at
org.springframework.web.context.support.AbstractRefreshableWebApplica
tionContext.refresh(AbstractRefreshableWebApplicationContext.java:156)
at
org.springframework.web.context.ContextLoader.createWebApplicationCon
text(ContextLoader.java:246)
at
org.springframework.web.context.ContextLoader.initWebApplicationConte
xt(ContextLoader.java:184)
at
org.springframework.web.context.ContextLoaderListener.contextInitiali
zed(ContextLoaderListener.java:49)
at
org.apache.catalina.core.StandardContext.listenerStart(StandardContex
t.java:3827)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4
334)

Anyone has a tip or suggestion of what is happening? The strange is that
application runs fine inside the ide.
Thanks in advance.

Lauro

-- 
View this message in context: 
http://www.nabble.com/-S2--Deploy-error-tf3792174.html#a10724834
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: ajax - Submit a form

2007-05-21 Thread Mansour
I still don't what wrong with this. I fixed few problems but still can 
not get the javascript function to execute when the request is being 
made. It send the request but the values for the form are not populated. 
Hopefully someone can find out what's wrong with my code.





script type=text/javascript language=javascript
dojo.event.topic.subscribe(/disableAll , function(data, type, request) {
 showMessage();
});
/script

table
   tr
   tds:a href=javascript:// 
onclick=changeState(true);edit/s:a

   tds:url id=ajaxSubmit value=/updateAccount.action /s:url

   s:submit theme=ajax href=%{ajaxSubmit} formId=MyData
   notifyTopics=/disableAllfd  save /s:submit

/td

   /tr
/table



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



[S2] form population problem

2007-05-21 Thread shadman

I can't seem to get values retrieved from the DB to populate on the form. The
list jsp and retrieving from DB work great, but values don't seem to make it
to the jsp. I pass the ID into the action method, retrieve the record, and
want to display the results.

struts.xml:
   action name=findDeptId class=actions.DepartmentAction
method=findById
 result name=inputjsps/errors.jsp/result
 result name=successjsps/edit_dept.jsp/result
 interceptor-ref name=crudStack/
   /action

DepartmentAction:
public String findById () throws Exception {
this.dept = getDaoManager().getDeptDao().findById(this.getId());
return SUCCESS;
}

Method fills dept object. also, getDept()  setDept() in action.

edit_dept.jsp:
  s:form action=save validate=true 
   table cellspacing=0 cellpadding=0 border=0
   tr
  td align=rightID:/td
  td
 s:property value=dept.deptId /
 s:hidden name=dept.deptId value=dept.deptName /
  /td
   /trtr
 s:textfield name=dept.deptName label=Dept Name
value=dept.deptName size=10 / 
   /tr
   /table
   /s:form

I have to be doing something simple wrong, I just don't see it.
shadman
-- 
View this message in context: 
http://www.nabble.com/-S2--form-population-problem-tf3792422.html#a10725666
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: ajax - Submit a form

2007-05-21 Thread Musachy Barroso

Use a regular submit (no ajax) and see if you values are submitted.

musachy

On 5/21/07, Mansour [EMAIL PROTECTED] wrote:


I still don't what wrong with this. I fixed few problems but still can
not get the javascript function to execute when the request is being
made. It send the request but the values for the form are not populated.
Hopefully someone can find out what's wrong with my code.




script type=text/javascript language=javascript
dojo.event.topic.subscribe(/disableAll , function(data, type, request) {
  showMessage();
});
/script

table
tr
tds:a href=javascript://
onclick=changeState(true);edit/s:a
tds:url id=ajaxSubmit value=/updateAccount.action /s:url

s:submit theme=ajax href=%{ajaxSubmit} formId=MyData
notifyTopics=/disableAllfd  save /s:submit

 /td
/tr
/table



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





--
Hey you! Would you help me to carry the stone? Pink Floyd


Re: [S2] Problem with ! notation

2007-05-21 Thread Roger Varley

Is dynamic method invocation turned on?


As an aside, why is dynamic method invocation turned off by default.

From experience this suggests that either the functionality is

experimental, or is not the sort of thing you should be using unless
you have good reason and know what you're doing. Are there any gotchas
I should know about?

Regards
Roger

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



RE: [S2] Problem with ! notation

2007-05-21 Thread Wesley Wannemacher

 
 Yes, Tiger is the webapp.
 
 My struts.xml contains
  action name=StartOrder
 class=com.mysite.ecommerce.actions.StartOrderAction method=input
  result/startOrder.jsp/result
 /action
 
 My struts.properties is located in WEB_INF/classes along with the
 struts.xml file and contains
 struts.devMode = true
 struts.enable.DynamicMethodInvocation = true
 
 If I call http://localhost:8084/Tiger/StartOrder.action then I can see
 that the input() method is called on StartOrder.action through using
 System.out.println(). However
 http://localhost:8084/Tiger/StartOrder!input.action gives There is no
 Action mapped for namespace / and action name StartOrder!input. -
 [unknown location]
 
 Is there anything else you need to see? I don't want to send too much
 unneccassary data
 

It appears that you are hardcoding your call to the input method...
Typically, I specify a method using wildcards. Your setup would look like
this - 

action name=StartOrder_*
 class=com.mysite.ecommerce.actions.StartOrderAction method={1}

Then whichever method I specify in the URL will be called. Of course, in my
scenario it defaults to 'execute' unless I specify otherwise.

-Wes

--
Wes Wannemacher
Director of Operations
Double A Trailer Sales, Inc.
[EMAIL PROTECTED]


smime.p7s
Description: S/MIME cryptographic signature


Re: ajax - Submit a form

2007-05-21 Thread Mansour
Yes they are submitted provided that the submit button is inside the 
form. Here's my code :



   tr
   td
   s:submit  href=/updateAccount.action 
   value=Save from inside the form w/o ajax 
   /s:submit

   /td
   /tr
   /s:form
/table
hr /

   script type=text/javascript language=javascript
   dojo.event.topic.subscribe(/disableAll , function(data, type, 
request) {

 showMessage();
   });
   /script

table
   tr
   tds:a href=javascript:// 
onclick=disableInputs(false);edit/s:a

   tds:url id=ajaxSubmit value=/updateAccount.action /s:url
   s:submit  href=%{ajaxSubmit}   notifyTopics=/disableAll
   theme=ajax formId=MyData save using ajax /s:submit
/td
   /tr
/table




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



Re: ajax - Submit a form

2007-05-21 Thread Musachy Barroso

If you add s:head debug=true / and use the ajax theme, is any error
logged?

musahcy

On 5/21/07, Mansour [EMAIL PROTECTED] wrote:


Yes they are submitted provided that the submit button is inside the
form. Here's my code :


tr
td
s:submit  href=/updateAccount.action
value=Save from inside the form w/o ajax
/s:submit
/td
/tr
/s:form
/table
hr /

script type=text/javascript language=javascript
dojo.event.topic.subscribe(/disableAll , function(data, type,
request) {
  showMessage();
});
/script

table
tr
tds:a href=javascript://
onclick=disableInputs(false);edit/s:a
tds:url id=ajaxSubmit value=/updateAccount.action /s:url
s:submit  href=%{ajaxSubmit}   notifyTopics=/disableAll
theme=ajax formId=MyData save using ajax /s:submit
 /td
/tr
/table




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





--
Hey you! Would you help me to carry the stone? Pink Floyd


Re: ajax - Submit a form

2007-05-21 Thread Mansour
No, I can not see any thing logged. Here' the whole JSP. it should give 
you an idea about what I am doing. I am trying to save/update an account 
and run a JS to disable the inputs.



%@ taglib prefix=s uri=/struts-tags%
%@ taglib prefix=c uri=http://java.sun.com/jsp/jstl/core%
%@ taglib uri=http://displaytag.sf.net; prefix=display%

s:head theme=ajax debug=true/s:head

script type=text/javascript
function disableInputs(flag)
{
if (flag == 'null') flag = true;
var inputs = document.getElementById(data_table);
inputs = inputs.getElementsByTagName('input');
for ( i = 0 ;i  inputs.length ; i++ )
   inputs[i].disabled = flag ;
}

function showMessage(){
   alert('test message!');
   disableInputs(true);
   }
/script

!-- show the account details --

table id=data_table 
   s:form id=MyData action=/updateAccount.action   
   tr
   tds:label value=AccId: //td
   tds:property value=acc.id /
   s:hidden name=acc.idvalue=${acc.id} id=acc.id //td
   /tr

   tr
   tds:label value=First Name //td
   tds:textfield name=acc.firstName disabled=true
   value=${acc.firstName} //td
   /tr
   tr
   tds:label value=Last Name:  //td
   tds:textfield name=acc.lastName disabled=true
   value=%{acc.lastName} //td
   /tr
   tr
   td
  
   s:submit  href=/updateAccount.action 
   value=Save from inside the form w/o ajax 
   /s:submit
  
   /td

   /tr
  
   /s:form


/table

hr /

script type=text/javascript language=javascript
dojo.event.topic.subscribe(/disableAll , function(data, type, request) {
 showMessage();
});
/script

table
   tr
   tds:a href=javascript:// 
onclick=disableInputs(false);edit/s:a

   tds:url id=ajaxSubmit value=/updateAccount.action /s:url
   s:submit  href=%{ajaxSubmit}   notifyTopics=/disableAll
   theme=ajax formId=MyData  save /s:submit
/td
   /tr
/table



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



RE: OOM Error (Java heap space) from 1800+ form elements, am I doing something wrong?

2007-05-21 Thread Forsberg, Mike
Posting to the group, since I believe a solution has been found.

It appears that my issue was something like a buffer overrun in the jsp.
A solution that we are testing is the following code snippet:

%@ page buffer=1024kb autoFlush=false %

The current size might be a little overkill but, my issue seems to have
vanished.

Thanks goes to my co-worker you pointed me in this direction.  Thanks,
also to the great support from this mailing list.

Mike

-Original Message-
From: Forsberg, Mike 
Sent: Friday, May 18, 2007 2:06 PM
To: user@struts.apache.org
Subject: OOM Error (Java heap space) from 1800+ form elements, am I
doing something wrong?

A form of approximately 1800 form elements is causing
java.lang.OutOfMemoryError: Java heap space.  When 1000 form elements
are used, no such error.

The environment:
- JBoss 4.0.5
- Struts 1.1
- A jsp page using struts html:form tags to start and end the form
block.  Then inside the form, xslt is used to parse a 300 element xml
document into 6 input tags per element.

What seems to be happening, the reset method for the form bean is
called. Then before any set methods are called, the OOME is thrown.

Any help would be appreciated.

Mike Forsberg
Software Engineer II
APM - APC
T 512.602.0220




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






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



Problems with an applet inside a struts + tiles jsp

2007-05-21 Thread Oren Livne

Dear All,

I am writing a Struts 1.3.8 web application. I'm using tiles, and in one 
of the JSPs participating a tiles definition I placed an applet tag. 
The tiles processor throws a path-not-found-exception, but the page is 
displayed correctly and the applet works flawlessly. This is the error 
message I get in my console:


15:22:11,421  INFO InvalidPathExceptionServlet:103 - Requested path was 
not found: /RU2/error/404

15:22:11,421  INFO InvalidPathExceptionServlet:104 - Requesting user: N/A
15:22:11,421  INFO TilesPreProcessor:216 - Tiles process complete; 
forward to /WEB-INF/common/tiles/template.jsp


(/RU2 is my context and /error/404 is a path configured in web.xml to 
handle HTTP 404 codes; so the exception is handled, but I don't even 
want to see any exception!). Here are the relevant pieces of the code. I 
would greatly appreciate an advice on how to get rid of this exception. 
Maybe it's related to my exception handling. I don't know.


Thanks so much in advance,
Oren Livne

- tiles definition: (extends a common definition whose pages don't seem 
to have any problems)


   definition name=.demoEE extends=.parserBaseDef
   put name=title value=parser.demo.title /
   put name=content  value=/WEB-INF/parser/jsp/demoEE.jsp /
   /definition

- demoEE.jsp: (when I remove the applet tags in the code below, the 
exception is gone)

%--
###
demoEE.jsp

Nava L. Livne i[EMAIL PROTECTED]/i
Academic Outreach and Continuing Education (AOCE)
1901 East South Campus Dr., Room 2197-E
University of Utah, Salt Lake City, UT 84112

Oren E. Livne i[EMAIL PROTECTED]/i
Academic Outreach and Continuing Education (AOCE)
1901 East South Campus Dr., Room 2197-D
  
Protected by U.S. Provisional Patent U-4003, February 2006


Mathematical expression parser demo page with the WebEQ equation editor 
applet that

generates inputs for the parser.
###
--%

%@ page language=java%
%@ page import=net.ruready.struts.common.imports.WebAppNames %
%@ taglib uri=http://struts.apache.org/tags-bean; prefix=bean%
%@ taglib uri=http://struts.apache.org/tags-html; prefix=html%
%@ taglib uri=http://struts.apache.org/tags-logic; prefix=logic%
%@ taglib uri=http://java.sun.com/jsp/jstl/core; prefix=c%
%@ taglib uri=http://java.sun.com/jsp/jstl/functions; prefix=fn%
%@ taglib uri=http://ruready.net/catalog; prefix=catalog%

%-- Useful definitions 
==--%


c:set var=WEBAPPNAMES_REQUEST_ATTRIBUTE_OLS_PARSER_DEMO_ARITHMETIC_MODES
   %= + WebAppNames.REQUEST.ATTRIBUTE.OLS_PARSER_DEMO_ARITHMETIC_MODES%
/c:set

c:set var=WEBAPPNAMES_REQUEST_ATTRIBUTE_TOKEN_PARSER_DEMO_RESULT
   %= + WebAppNames.REQUEST.ATTRIBUTE.TOKEN.PARSER_DEMO_RESULT%
/c:set

%-- JSP body begins here 
--%


%--
==
Page title and demo instructions
==
--%
%-- centerh1bean:message key=parser.demo.title //h1/center --%
bean:message key=parser.demo.instructions/
p/

%--
==
Top table: submit form + options control
==
--%
html:form action=/demoEE

%-- Notify the action that the input is in EE format (default value: 
false) --%

html:hidden property=formatEE value=true /

%-- Display validation errors unless this is a fresh form --%
logic:equal name=demoForm property=empty value=false
   span class=error /
   html:errors/
   /span
/logic:equal
p/

table width=100% border=0
   %--
   
   Form data fields
   
   --%
   tr
   %-- Reference string label --%
   th align=left class=section width=25%
   bean:message key=parser.demo.form.referenceString.label /
   /th

   %-- Reference string text area --%
   td align=left width=40%
   html:hidden property=referenceString /
   %-- WebEQ EE applet --%
   applet codebase=/RU2/lib
   archive=WebEQApplet.jar code=webeq3.editor.InputControl
   width=700 height=150 name=referenceEE
   param name=useslibrary value=WebEQApplet
param name=useslibrarycodebase value=WebEQApplet.cab
   param name=useslibraryversion value=3,7,0,0
   param name=toolbar value=tbincl 
name='#standard'//tb /
   param name=eq value=bean:write name='demoForm' 
property='referenceString' /

   /applet
   /td
  
   %--

   Vertical space
   --%
   td rowspan=2 valign=top width=5%
   nbsp;
   /td
  
   %--

   
   Parser Control Options
   
  

Re: Problems with an applet inside a struts + tiles jsp

2007-05-21 Thread Martin Gainty

Good Evening Mr Levine

I wanted to address your question
If we look at the action servlet declaration in /WEB-INF/web.xml we are 
displayed

   servlet
   servlet-nameaction/servlet-name
   
servlet-classcom.opensymphony.webwork.dispatcher.ServletDispatcher/servlet-class
   /servlet
   servlet-mapping
   servlet-nameaction/servlet-name
   url-pattern*.action/url-pattern
   /servlet-mapping

Any files with extension of 'action' has an assigned identifier of action
ALL forward which results to extension of action are served by class 
com.opensymphony.webwork.dispatcher.ServletDispatcher


Does this answer your question?
Martin --
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

- Original Message - 
From: Oren Livne [EMAIL PROTECTED]

To: user@struts.apache.org
Sent: Monday, May 21, 2007 5:30 PM
Subject: Problems with an applet inside a struts + tiles jsp



Dear All,

I am writing a Struts 1.3.8 web application. I'm using tiles, and in one 
of the JSPs participating a tiles definition I placed an applet tag. The 
tiles processor throws a path-not-found-exception, but the page is 
displayed correctly and the applet works flawlessly. This is the error 
message I get in my console:


15:22:11,421  INFO InvalidPathExceptionServlet:103 - Requested path was 
not found: /RU2/error/404

15:22:11,421  INFO InvalidPathExceptionServlet:104 - Requesting user: N/A
15:22:11,421  INFO TilesPreProcessor:216 - Tiles process complete; forward 
to /WEB-INF/common/tiles/template.jsp


(/RU2 is my context and /error/404 is a path configured in web.xml to 
handle HTTP 404 codes; so the exception is handled, but I don't even want 
to see any exception!). Here are the relevant pieces of the code. I would 
greatly appreciate an advice on how to get rid of this exception. Maybe 
it's related to my exception handling. I don't know.


Thanks so much in advance,
Oren Livne

- tiles definition: (extends a common definition whose pages don't seem to 
have any problems)


   definition name=.demoEE extends=.parserBaseDef
   put name=title value=parser.demo.title /
   put name=content  value=/WEB-INF/parser/jsp/demoEE.jsp /
   /definition

- demoEE.jsp: (when I remove the applet tags in the code below, the 
exception is gone)

%--
###
demoEE.jsp

Nava L. Livne i[EMAIL PROTECTED]/i
Academic Outreach and Continuing Education (AOCE)
1901 East South Campus Dr., Room 2197-E
University of Utah, Salt Lake City, UT 84112

Oren E. Livne i[EMAIL PROTECTED]/i
Academic Outreach and Continuing Education (AOCE)
1901 East South Campus Dr., Room 2197-D
  Protected by U.S. Provisional Patent U-4003, February 2006

Mathematical expression parser demo page with the WebEQ equation editor 
applet that

generates inputs for the parser.
###
--%

%@ page language=java%
%@ page import=net.ruready.struts.common.imports.WebAppNames %
%@ taglib uri=http://struts.apache.org/tags-bean; prefix=bean%
%@ taglib uri=http://struts.apache.org/tags-html; prefix=html%
%@ taglib uri=http://struts.apache.org/tags-logic; prefix=logic%
%@ taglib uri=http://java.sun.com/jsp/jstl/core; prefix=c%
%@ taglib uri=http://java.sun.com/jsp/jstl/functions; prefix=fn%
%@ taglib uri=http://ruready.net/catalog; prefix=catalog%

%-- Useful definitions 
==--%


c:set 
var=WEBAPPNAMES_REQUEST_ATTRIBUTE_OLS_PARSER_DEMO_ARITHMETIC_MODES
   %= + 
WebAppNames.REQUEST.ATTRIBUTE.OLS_PARSER_DEMO_ARITHMETIC_MODES%

/c:set

c:set var=WEBAPPNAMES_REQUEST_ATTRIBUTE_TOKEN_PARSER_DEMO_RESULT
   %= + WebAppNames.REQUEST.ATTRIBUTE.TOKEN.PARSER_DEMO_RESULT%
/c:set

%-- JSP body begins here 
--%


%--
==
Page title and demo instructions
==
--%
%-- centerh1bean:message key=parser.demo.title 
//h1/center --%

bean:message key=parser.demo.instructions/
p/

%--
==
Top table: submit form + options control
==
--%
html:form action=/demoEE

%-- Notify the action that the input is in EE format (default value: 
false) --%

html:hidden property=formatEE value=true /

%-- Display validation errors unless this is a fresh form --%
logic:equal name=demoForm property=empty value=false
   span class=error /
   html:errors/
   /span
/logic:equal
p/

table width=100% border=0
   

Re: Problems with an applet inside a struts + tiles jsp

2007-05-21 Thread Oren Livne

Dear Martin,
Thanks so much for your kind reply, but unfortunately I didn't 
understand it and I don't think it answers my question. You might be 
referring to Struts 2, but I am still using Struts 1.3.8 so my action 
servlet is declared as follows:


   !-- ActionServlet class --
   servlet-nameaction/servlet-name
   servlet-class
   org.apache.struts.action.ActionServlet
   /servlet-class

My problem is an applet tag in a JSP. But maybe you did answer and I 
didn't understand your answer. Could you kindly tell me again?


Thanks so much,
Oren Livne

Martin Gainty wrote:

Good Evening Mr Levine

I wanted to address your question
If we look at the action servlet declaration in /WEB-INF/web.xml we 
are displayed

   servlet
   servlet-nameaction/servlet-name
   
servlet-classcom.opensymphony.webwork.dispatcher.ServletDispatcher/servlet-class 


   /servlet
   servlet-mapping
   servlet-nameaction/servlet-name
   url-pattern*.action/url-pattern
   /servlet-mapping

Any files with extension of 'action' has an assigned identifier of action
ALL forward which results to extension of action are served by class 
com.opensymphony.webwork.dispatcher.ServletDispatcher


Does this answer your question?
Martin --
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please 
notify

the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

- Original Message - From: Oren Livne [EMAIL PROTECTED]
To: user@struts.apache.org
Sent: Monday, May 21, 2007 5:30 PM
Subject: Problems with an applet inside a struts + tiles jsp



Dear All,

I am writing a Struts 1.3.8 web application. I'm using tiles, and in 
one of the JSPs participating a tiles definition I placed an applet 
tag. The tiles processor throws a path-not-found-exception, but the 
page is displayed correctly and the applet works flawlessly. This is 
the error message I get in my console:


15:22:11,421  INFO InvalidPathExceptionServlet:103 - Requested path 
was not found: /RU2/error/404
15:22:11,421  INFO InvalidPathExceptionServlet:104 - Requesting user: 
N/A
15:22:11,421  INFO TilesPreProcessor:216 - Tiles process complete; 
forward to /WEB-INF/common/tiles/template.jsp


(/RU2 is my context and /error/404 is a path configured in web.xml to 
handle HTTP 404 codes; so the exception is handled, but I don't even 
want to see any exception!). Here are the relevant pieces of the 
code. I would greatly appreciate an advice on how to get rid of this 
exception. Maybe it's related to my exception handling. I don't know.


Thanks so much in advance,
Oren Livne

- tiles definition: (extends a common definition whose pages don't 
seem to have any problems)


   definition name=.demoEE extends=.parserBaseDef
   put name=title value=parser.demo.title /
   put name=content  
value=/WEB-INF/parser/jsp/demoEE.jsp /

   /definition

- demoEE.jsp: (when I remove the applet tags in the code below, the 
exception is gone)

%--
### 


demoEE.jsp

Nava L. Livne i[EMAIL PROTECTED]/i
Academic Outreach and Continuing Education (AOCE)
1901 East South Campus Dr., Room 2197-E
University of Utah, Salt Lake City, UT 84112

Oren E. Livne i[EMAIL PROTECTED]/i
Academic Outreach and Continuing Education (AOCE)
1901 East South Campus Dr., Room 2197-D
  Protected by U.S. Provisional Patent U-4003, February 2006

Mathematical expression parser demo page with the WebEQ equation 
editor applet that

generates inputs for the parser.
### 


--%

%@ page language=java%
%@ page import=net.ruready.struts.common.imports.WebAppNames %
%@ taglib uri=http://struts.apache.org/tags-bean; prefix=bean%
%@ taglib uri=http://struts.apache.org/tags-html; prefix=html%
%@ taglib uri=http://struts.apache.org/tags-logic; prefix=logic%
%@ taglib uri=http://java.sun.com/jsp/jstl/core; prefix=c%
%@ taglib uri=http://java.sun.com/jsp/jstl/functions; prefix=fn%
%@ taglib uri=http://ruready.net/catalog; prefix=catalog%

%-- Useful definitions 
==--%


c:set 
var=WEBAPPNAMES_REQUEST_ATTRIBUTE_OLS_PARSER_DEMO_ARITHMETIC_MODES
   %= + 
WebAppNames.REQUEST.ATTRIBUTE.OLS_PARSER_DEMO_ARITHMETIC_MODES%

/c:set

c:set var=WEBAPPNAMES_REQUEST_ATTRIBUTE_TOKEN_PARSER_DEMO_RESULT
   %= + WebAppNames.REQUEST.ATTRIBUTE.TOKEN.PARSER_DEMO_RESULT%
/c:set

%-- JSP body begins here 
--%


%--
==
Page title and demo instructions
==
--%
%-- centerh1bean:message 

Re: Problems with an applet inside a struts + tiles jsp

2007-05-21 Thread Oren Livne

Dear Martin,
Thanks so much for your kind reply, but unfortunately I didn't 
understand it and I don't think it answers my question. You might be 
referring to Struts 2, but I am still using Struts 1.3.8 so my action 
servlet is declared as follows:


   !-- ActionServlet class --
   servlet-nameaction/servlet-name
   servlet-class
   org.apache.struts.action.ActionServlet
   /servlet-class

My problem is an applet tag in a JSP. But maybe you did answer and I 
didn't understand your answer. Could you kindly tell me again?


Thanks so much,
Oren Livne

Martin Gainty wrote:

Good Evening Mr Levine

I wanted to address your question
If we look at the action servlet declaration in /WEB-INF/web.xml we 
are displayed

   servlet
   servlet-nameaction/servlet-name
   
servlet-classcom.opensymphony.webwork.dispatcher.ServletDispatcher/servlet-class 


   /servlet
   servlet-mapping
   servlet-nameaction/servlet-name
   url-pattern*.action/url-pattern
   /servlet-mapping

Any files with extension of 'action' has an assigned identifier of action
ALL forward which results to extension of action are served by class 
com.opensymphony.webwork.dispatcher.ServletDispatcher


Does this answer your question?
Martin --
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please 
notify

the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

- Original Message - From: Oren Livne [EMAIL PROTECTED]
To: user@struts.apache.org
Sent: Monday, May 21, 2007 5:30 PM
Subject: Problems with an applet inside a struts + tiles jsp



Dear All,

I am writing a Struts 1.3.8 web application. I'm using tiles, and in 
one of the JSPs participating a tiles definition I placed an applet 
tag. The tiles processor throws a path-not-found-exception, but the 
page is displayed correctly and the applet works flawlessly. This is 
the error message I get in my console:


15:22:11,421  INFO InvalidPathExceptionServlet:103 - Requested path 
was not found: /RU2/error/404
15:22:11,421  INFO InvalidPathExceptionServlet:104 - Requesting user: 
N/A
15:22:11,421  INFO TilesPreProcessor:216 - Tiles process complete; 
forward to /WEB-INF/common/tiles/template.jsp


(/RU2 is my context and /error/404 is a path configured in web.xml to 
handle HTTP 404 codes; so the exception is handled, but I don't even 
want to see any exception!). Here are the relevant pieces of the 
code. I would greatly appreciate an advice on how to get rid of this 
exception. Maybe it's related to my exception handling. I don't know.


Thanks so much in advance,
Oren Livne

- tiles definition: (extends a common definition whose pages don't 
seem to have any problems)


   definition name=.demoEE extends=.parserBaseDef
   put name=title value=parser.demo.title /
   put name=content  
value=/WEB-INF/parser/jsp/demoEE.jsp /

   /definition

- demoEE.jsp: (when I remove the applet tags in the code below, the 
exception is gone)

%--
### 


demoEE.jsp

Nava L. Livne i[EMAIL PROTECTED]/i
Academic Outreach and Continuing Education (AOCE)
1901 East South Campus Dr., Room 2197-E
University of Utah, Salt Lake City, UT 84112

Oren E. Livne i[EMAIL PROTECTED]/i
Academic Outreach and Continuing Education (AOCE)
1901 East South Campus Dr., Room 2197-D
  Protected by U.S. Provisional Patent U-4003, February 2006

Mathematical expression parser demo page with the WebEQ equation 
editor applet that

generates inputs for the parser.
### 


--%

%@ page language=java%
%@ page import=net.ruready.struts.common.imports.WebAppNames %
%@ taglib uri=http://struts.apache.org/tags-bean; prefix=bean%
%@ taglib uri=http://struts.apache.org/tags-html; prefix=html%
%@ taglib uri=http://struts.apache.org/tags-logic; prefix=logic%
%@ taglib uri=http://java.sun.com/jsp/jstl/core; prefix=c%
%@ taglib uri=http://java.sun.com/jsp/jstl/functions; prefix=fn%
%@ taglib uri=http://ruready.net/catalog; prefix=catalog%

%-- Useful definitions 
==--%


c:set 
var=WEBAPPNAMES_REQUEST_ATTRIBUTE_OLS_PARSER_DEMO_ARITHMETIC_MODES
   %= + 
WebAppNames.REQUEST.ATTRIBUTE.OLS_PARSER_DEMO_ARITHMETIC_MODES%

/c:set

c:set var=WEBAPPNAMES_REQUEST_ATTRIBUTE_TOKEN_PARSER_DEMO_RESULT
   %= + WebAppNames.REQUEST.ATTRIBUTE.TOKEN.PARSER_DEMO_RESULT%
/c:set

%-- JSP body begins here 
--%


%--
==
Page title and demo instructions
==
--%
%-- centerh1bean:message 

Re: Problems with an applet inside a struts + tiles jsp

2007-05-21 Thread Martin Gainty

As I cannot guess the contents please display the appropriate web.xml

M--
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

- Original Message - 
From: Oren Livne [EMAIL PROTECTED]

To: Struts Users Mailing List user@struts.apache.org
Sent: Monday, May 21, 2007 6:44 PM
Subject: Re: Problems with an applet inside a struts + tiles jsp



Dear Martin,
Thanks so much for your kind reply, but unfortunately I didn't understand 
it and I don't think it answers my question. You might be referring to 
Struts 2, but I am still using Struts 1.3.8 so my action servlet is 
declared as follows:


   !-- ActionServlet class --
   servlet-nameaction/servlet-name
   servlet-class
   org.apache.struts.action.ActionServlet
   /servlet-class

My problem is an applet tag in a JSP. But maybe you did answer and I 
didn't understand your answer. Could you kindly tell me again?


Thanks so much,
Oren Livne

Martin Gainty wrote:

Good Evening Mr Levine

I wanted to address your question
If we look at the action servlet declaration in /WEB-INF/web.xml we are 
displayed

   servlet
   servlet-nameaction/servlet-name

servlet-classcom.opensymphony.webwork.dispatcher.ServletDispatcher/servlet-class
   /servlet
   servlet-mapping
   servlet-nameaction/servlet-name
   url-pattern*.action/url-pattern
   /servlet-mapping

Any files with extension of 'action' has an assigned identifier of action
ALL forward which results to extension of action are served by class 
com.opensymphony.webwork.dispatcher.ServletDispatcher


Does this answer your question?
Martin --
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please 
notify

the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

- Original Message - From: Oren Livne [EMAIL PROTECTED]
To: user@struts.apache.org
Sent: Monday, May 21, 2007 5:30 PM
Subject: Problems with an applet inside a struts + tiles jsp



Dear All,

I am writing a Struts 1.3.8 web application. I'm using tiles, and in one 
of the JSPs participating a tiles definition I placed an applet tag. 
The tiles processor throws a path-not-found-exception, but the page is 
displayed correctly and the applet works flawlessly. This is the error 
message I get in my console:


15:22:11,421  INFO InvalidPathExceptionServlet:103 - Requested path was 
not found: /RU2/error/404
15:22:11,421  INFO InvalidPathExceptionServlet:104 - Requesting user: 
N/A
15:22:11,421  INFO TilesPreProcessor:216 - Tiles process complete; 
forward to /WEB-INF/common/tiles/template.jsp


(/RU2 is my context and /error/404 is a path configured in web.xml to 
handle HTTP 404 codes; so the exception is handled, but I don't even 
want to see any exception!). Here are the relevant pieces of the code. I 
would greatly appreciate an advice on how to get rid of this exception. 
Maybe it's related to my exception handling. I don't know.


Thanks so much in advance,
Oren Livne

- tiles definition: (extends a common definition whose pages don't seem 
to have any problems)


   definition name=.demoEE extends=.parserBaseDef
   put name=title value=parser.demo.title /
   put name=content  value=/WEB-INF/parser/jsp/demoEE.jsp 
/

   /definition

- demoEE.jsp: (when I remove the applet tags in the code below, the 
exception is gone)

%--
###
demoEE.jsp

Nava L. Livne i[EMAIL PROTECTED]/i
Academic Outreach and Continuing Education (AOCE)
1901 East South Campus Dr., Room 2197-E
University of Utah, Salt Lake City, UT 84112

Oren E. Livne i[EMAIL PROTECTED]/i
Academic Outreach and Continuing Education (AOCE)
1901 East South Campus Dr., Room 2197-D
  Protected by U.S. Provisional Patent U-4003, February 2006

Mathematical expression parser demo page with the WebEQ equation editor 
applet that

generates inputs for the parser.
###
--%

%@ page language=java%
%@ page import=net.ruready.struts.common.imports.WebAppNames %
%@ taglib uri=http://struts.apache.org/tags-bean; prefix=bean%
%@ taglib uri=http://struts.apache.org/tags-html; prefix=html%
%@ taglib uri=http://struts.apache.org/tags-logic; prefix=logic%
%@ taglib uri=http://java.sun.com/jsp/jstl/core; prefix=c%
%@ taglib uri=http://java.sun.com/jsp/jstl/functions; prefix=fn%
%@ taglib uri=http://ruready.net/catalog; prefix=catalog%

%-- Useful definitions 

How can I access a collection of object using struts tags?

2007-05-21 Thread hk

I have a bean, which has a class that contains a ArrayList of another class.
In this case, how can I access the property of the last class in a JSP page.

For example, the business object Movie has a class TitleStores that contains
a property of titlestores, which is a conllection of a class store. And, I
want to access and ourput a property of a store, such as storeID, name, etc
by using struts tags, such as bean:write. 


public class Movie
{
private String studio = null;
private Genres genres = null;   // ArrayList
private TitleStores titleStores = null;
private String rating = null;
private String language = null;
private int availableStock = -1; // For test
private CastMembers  castMembers = null;// ArrayList

}

public class TitleStores {

private ArrayList titleStores;

private int storeID;
private String  name;
private String  phone;
private String  street;
private String  city;
private String  state;
private String  owner;
private String  zipCode;   
private String  policy;
}

public class Store {
private int storeID;
private String  name;
private String  phone;
private String  street;
private String  city;
private String  state;
private String  owner;
private String  zipCode;   
private String  policy;
//private Policies policies;
...
}
-- 
View this message in context: 
http://www.nabble.com/How-can-I-access-a-collection-of-object-using-struts-tags--tf3793680.html#a10729836
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: ajax - Submit a form

2007-05-21 Thread Mansour
I am still having this problem. Did any one went through some thing 
similar when using ajax to submit a form from a link or a submit Button 
and when used notifyTopic ?


The problem is that the form fields are never populated in the action ! 
Any help ?



Mansour wrote:
No, I can not see any thing logged. Here' the whole JSP. it should 
give you an idea about what I am doing. I am trying to save/update an 
account and run a JS to disable the inputs.



%@ taglib prefix=s uri=/struts-tags%
%@ taglib prefix=c uri=http://java.sun.com/jsp/jstl/core%
%@ taglib uri=http://displaytag.sf.net; prefix=display%

s:head theme=ajax debug=true/s:head

script type=text/javascript
function disableInputs(flag)
{
if (flag == 'null') flag = true;
var inputs = document.getElementById(data_table);
inputs = inputs.getElementsByTagName('input');
for ( i = 0 ;i  inputs.length ; i++ )
   inputs[i].disabled = flag ;
}

function showMessage(){
   alert('test message!');
   disableInputs(true);
   }
/script

!-- show the account details --

table id=data_table 
   s:form id=MyData action=/updateAccount.action   
   tr
   tds:label value=AccId: //td
   tds:property value=acc.id /
   s:hidden name=acc.idvalue=${acc.id} id=acc.id 
//td

   /tr

   tr
   tds:label value=First Name //td
   tds:textfield name=acc.firstName disabled=true
   value=${acc.firstName} //td
   /tr
   tr
   tds:label value=Last Name:  //td
   tds:textfield name=acc.lastName disabled=true
   value=%{acc.lastName} //td
   /tr
   tr
   td
 s:submit  href=/updateAccount.action
value=Save from inside the form w/o ajax/s:submit

 /td
   /tr
 /s:form

/table

hr /

script type=text/javascript language=javascript
dojo.event.topic.subscribe(/disableAll , function(data, type, 
request) {

 showMessage();
});
/script

table
   tr
   tds:a href=javascript:// 
onclick=disableInputs(false);edit/s:a

   tds:url id=ajaxSubmit value=/updateAccount.action /s:url
   s:submit  href=%{ajaxSubmit}   notifyTopics=/disableAll
   theme=ajax formId=MyData  save /s:submit
/td
   /tr
/table



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





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



How to do the following in S@

2007-05-21 Thread tom tom
Hi,

One page we got a Iterator containing the Action
Names, which means Actions names are not known
earlier,

How can we retrieve the value inside the URL tag.

How can we retrieve the dynamic action names like this
in S2

that is in s:url tag how to give a dynamic action
value from the iterator

s:iterator id=testID value=#session.xxx
tr
  td valign=middle bgcolor=white 

s:url id=url action=NEED TO GET FROM testID e.g
testID.actionName 

s:param name=subjectYear value=year id=course
/
s:param name=courseId value=courseId
id=course/
/s:url

s:a href=%{url}
 span id=blue
 Subjects
 /span
/s:a
  /td
 /s:iterator


   
Boardwalk
 for $500? In 2007? Ha! Play Monopoly Here and Now (it's updated for today's 
economy) at Yahoo! Games.
http://get.games.yahoo.com/proddesc?gamekey=monopolyherenow  

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



Re: How can I access a collection of object using struts tags?

2007-05-21 Thread Nuwan Chandrasoma

Hi,

if you are using struts 1.x you can use nested tags, look at this link for a 
sample


http://www.laliluna.de/struts-nested-iteration-tutorial.html

Thanks,

Nuwan


- Original Message - 
From: hk [EMAIL PROTECTED]

To: user@struts.apache.org
Sent: Tuesday, May 22, 2007 12:57 AM
Subject: How can I access a collection of object using struts tags?




I have a bean, which has a class that contains a ArrayList of another 
class.
In this case, how can I access the property of the last class in a JSP 
page.


For example, the business object Movie has a class TitleStores that 
contains

a property of titlestores, which is a conllection of a class store. And, I
want to access and ourput a property of a store, such as storeID, name, 
etc

by using struts tags, such as bean:write.


public class Movie
{
   private String studio = null;
   private Genres genres = null;   // ArrayList
   private TitleStores titleStores = null;
   private String rating = null;
   private String language = null;
   private int availableStock = -1; // For test
   private CastMembers  castMembers = null;// ArrayList

}

public class TitleStores {

   private ArrayList titleStores;

   private int storeID;
   private String  name;
   private String  phone;
   private String  street;
   private String  city;
   private String  state;
   private String  owner;
   private String  zipCode;
   private String  policy;
}

public class Store {
   private int storeID;
   private String  name;
   private String  phone;
   private String  street;
   private String  city;
   private String  state;
   private String  owner;
   private String  zipCode;
   private String  policy;
   //private Policies policies;
...
}
--
View this message in context: 
http://www.nabble.com/How-can-I-access-a-collection-of-object-using-struts-tags--tf3793680.html#a10729836

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


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




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



Re: ajax - Submit a form

2007-05-21 Thread Mansour
I FOUND IT. Apparently it's not possible to modify the DOM during the 
request. But when it's over we can do it:


Here's the code:

script type=text/javascript language=javascript
dojo.event.topic.subscribe(/disableAll , function(data , type, request) {
 if (type == 'load') {
disableInputs(true);
 }
});
/script


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



Re: How to do the following in S@

2007-05-21 Thread tom tom
In Struts 1.x we achieved the following by html:el
tag
--- tom tom [EMAIL PROTECTED] wrote:

 Hi,
 
 One page we got a Iterator containing the Action
 Names, which means Actions names are not known
 earlier,
 
 How can we retrieve the value inside the URL tag.
 
 How can we retrieve the dynamic action names like
 this
 in S2
 
 that is in s:url tag how to give a dynamic action
 value from the iterator
 
 s:iterator id=testID value=#session.xxx
 tr
   td valign=middle bgcolor=white 
   
 s:url id=url action=NEED TO GET FROM testID e.g
 testID.actionName 
 
 s:param name=subjectYear value=year id=course
 /
 s:param name=courseId value=courseId
 id=course/
   /s:url
 
   s:a href=%{url}
span id=blue
Subjects
/span
   /s:a
   /td
  /s:iterator
 
 


Boardwalk
 for $500? In 2007? Ha! Play Monopoly Here and Now
 (it's updated for today's economy) at Yahoo! Games.

http://get.games.yahoo.com/proddesc?gamekey=monopolyherenow
  
 

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



   
Luggage?
 GPS? Comic books? 
Check out fitting gifts for grads at Yahoo! Search
http://search.yahoo.com/search?fr=oni_on_mailp=graduation+giftscs=bz

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



Re: Optiontransferselect button customization.

2007-05-21 Thread Vijay Prajapati

Hi,
   This is Vijay and currently using Struts2.0.6 production viersion in my
application development.
I have been used almost all tags in Struts2.0.6 but there are problem in s:
optiontransferselect tag. It doesn't include cssClass and cssStyle of
Second Select box at run time.
So Is there any solution for it?
If any one has solved this problem in new version then please let me know.
Even I want to change order of left move and right move button so can i do
it?

I am here giving code for this tag.

s:optiontransferselect name=systemName list=systems multiple=true
leftTitle=%{getText('addgroupmanager.apceform.allSystems')}
doubleName=groupSystems
doubleList=systemgroup doubleMultiple =true rightTitle=%{getText('
addgroupmanager.apceform.groupsystems ')} buttonCssClass=formInputButton
allowAddToRight =true addToRightLabel=%{' '} allowAddToLeft=true
addToLeftLabel=%{'  '} allowUpDownOnLeft=false allowUpDownOnRight=false
allowAddAllToLeft=false allowAddAllToRight= false allowSelectAll=false
required= true/

Please help me ASAP.

Thank you,
Vijay Prajapati


On 4/26/07, Laurie Harper [EMAIL PROTECTED] wrote:


Felipe Rodrigues wrote:
 Hi guys,

 Can I somehow change the button (e.g. addAllToLeft) of a
 Optiontransferselect to some image? I imagine it can be done by changing
the
 ftl, but I'd like some clues to do that.

For some documentation on themes and extending/customizing them, see here:

http://struts.apache.org/2.x/docs/themes-and-templates.html
http://struts.apache.org/2.x/docs/extending-themes.html

 Would be great to define some id
 for these buttons, then we could change it by css.
 How about that?

I don't know off hand what the markup looks like for this component, but
that may already be possible with the appropriate selectors. If not,
customize the theme and make it so :-)

L.


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