Re: html:form windowstate

2008-12-16 Thread Nils-Helge Garli Hegvik
You can probably use the 'var' attribute of the portlet:actionURL tag
to store the url as a variable which you can reference by an
expression in the html:form tag. Take a look at the tag reference for
the portlet tags (PLT.22.2) in the JSR168 spec [1] for details.

Nils-H

[1] - http://jcp.org/aboutJava/communityprocess/final/jsr168/index.html

On Tue, Dec 16, 2008 at 12:47 PM, Evert Lammerts evert.lamme...@sara.nl wrote:
 Hi all,

 Using struts 1.3.8 I'm trying to use the struts-html taglib to create a form 
 attribute that submits the form to a maximized window state, like possible 
 with the actionURL tag:

 form action=portlet:actionURL windowState=%= 
 WindowState.MAXIMIZED.toString() %
portlet:param name=struts_action value=/my/action /
/portlet:actionURL
method=POST

 Is there a way to do this? Maybe with a hidden form input?

 Thanks,
 Evert Lammerts


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



RE: html:form windowstate

2008-12-16 Thread Evert Lammerts
Hi Nils,

I've tried your suggestion but it doesn't seem to be possible. The action 
attribute in html:form expects an Action URI, while actionURL creates an 
absolute URL. Still, being a beginner with this, I'm pretty sure I'm missing 
something - I guess it IS possible to create a form tag that submits to a 
WindowState.MAXIMIZED state.

Thanks, Evert Lammerts

-Original Message-
From: Nils-Helge Garli Hegvik [mailto:nil...@gmail.com] 
Sent: dinsdag 16 december 2008 13:07
To: Struts Users Mailing List
Subject: Re: html:form windowstate

You can probably use the 'var' attribute of the portlet:actionURL tag
to store the url as a variable which you can reference by an
expression in the html:form tag. Take a look at the tag reference for
the portlet tags (PLT.22.2) in the JSR168 spec [1] for details.

Nils-H

[1] - http://jcp.org/aboutJava/communityprocess/final/jsr168/index.html

On Tue, Dec 16, 2008 at 12:47 PM, Evert Lammerts evert.lamme...@sara.nl wrote:
 Hi all,

 Using struts 1.3.8 I'm trying to use the struts-html taglib to create a form 
 attribute that submits the form to a maximized window state, like possible 
 with the actionURL tag:

 form action=portlet:actionURL windowState=%= 
 WindowState.MAXIMIZED.toString() %
portlet:param name=struts_action value=/my/action /
/portlet:actionURL
method=POST

 Is there a way to do this? Maybe with a hidden form input?

 Thanks,
 Evert Lammerts


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


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



Re: html:form windowstate

2008-12-16 Thread Nils-Helge Garli Hegvik
Are you using the struts 1 portlet bridge?
(http://portals.apache.org/bridges/multiproject/portals-bridges-struts)
Haven't used it myself, but I'd be surprised if the framework didn't
support creating portlet urls. I have only used a WebSphere
Portal-proprietary extension which (from what I remember) created
portlet urls automatically.

Nils-H


On Tue, Dec 16, 2008 at 5:27 PM, Evert Lammerts evert.lamme...@sara.nl wrote:
 Hi Nils,

 I've tried your suggestion but it doesn't seem to be possible. The action 
 attribute in html:form expects an Action URI, while actionURL creates an 
 absolute URL. Still, being a beginner with this, I'm pretty sure I'm missing 
 something - I guess it IS possible to create a form tag that submits to a 
 WindowState.MAXIMIZED state.

 Thanks, Evert Lammerts

 -Original Message-
 From: Nils-Helge Garli Hegvik [mailto:nil...@gmail.com]
 Sent: dinsdag 16 december 2008 13:07
 To: Struts Users Mailing List
 Subject: Re: html:form windowstate

 You can probably use the 'var' attribute of the portlet:actionURL tag
 to store the url as a variable which you can reference by an
 expression in the html:form tag. Take a look at the tag reference for
 the portlet tags (PLT.22.2) in the JSR168 spec [1] for details.

 Nils-H

 [1] - http://jcp.org/aboutJava/communityprocess/final/jsr168/index.html

 On Tue, Dec 16, 2008 at 12:47 PM, Evert Lammerts evert.lamme...@sara.nl 
 wrote:
 Hi all,

 Using struts 1.3.8 I'm trying to use the struts-html taglib to create a form 
 attribute that submits the form to a maximized window state, like possible 
 with the actionURL tag:

 form action=portlet:actionURL windowState=%= 
 WindowState.MAXIMIZED.toString() %
portlet:param name=struts_action value=/my/action /
/portlet:actionURL
method=POST

 Is there a way to do this? Maybe with a hidden form input?

 Thanks,
 Evert Lammerts


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


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



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



Re: html:form styleId name attribute javascript issue

2007-08-06 Thread Paul Benedict
Use the getElementById scripting method.

On 8/6/07, john lee [EMAIL PROTECTED] wrote:

 I have two file, and try to test javascript, but javascript can not access
 document.form.

   Can one know why? inside html:form, styleId  Name attribute? if so,
 what is the solution for that?

   i use strusts 1.3

   tks in advance

   john


   one file is javacript file, called my.js
   
   function loader(){
  var form=document.form[partsearchinput];
  from.setAttribute(autocomplete,off);
   }

   -


   second file is test file, called my.jsp
   -
   script type=text/javascript src=my.js/script
   html
   body onload=loader() 

   html:form styleId=partsearchinput  action=partsearchinput
html:text property=part styleId=part /
   /html:form
   /body
   /html





 -
 Sick sense of humor? Visit Yahoo! TV's Comedy with an Edge to see what's
 on, when.


Re: html:form array submit, capture inside ActionFrom question

2007-04-20 Thread Dave Newton
--- john lee [EMAIL PROTECTED] wrote:
 possible for me to implement the following code?
   % 
 for (i=1:i=10:i++) 
 {
response.Write(html:form action='sth.do' 
 styleId=+i);
response.Write(html:text property=part
 value=+i);
response.Write(html:submit/);
response.Write(/html:form); 
}
   %

   but, how to capature form(0), form(1) with
 corrsponsed part inside ActionForm ?

I don't think so, because the S1 tags won't be
compiled: you'll just get raw tags in the output.

d.


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



Re: html:form array submit, capture inside ActionFrom question

2007-04-20 Thread john lee
what is S1 tags? i still use struts 1.3.8.
   
  So, no possible to submit formay array?
   
  tks
   
  john

Dave Newton [EMAIL PROTECTED] wrote:
  --- john lee wrote:
 possible for me to implement the following code?
  for (i=1:i {
response.Write( styleId=+i);
response.Write( value=+i);
response.Write();
response.Write(); 
}
   %
 
 but, how to capature form(0), form(1) with
 corrsponsed part inside ActionForm ?

I don't think so, because the S1 tags won't be
compiled: you'll just get raw tags in the output.

d.


__
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



   
-
Ahhh...imagining that irresistible new car smell?
 Check outnew cars at Yahoo! Autos.

Re: html:form array submit, capture inside ActionFrom question

2007-04-20 Thread David Conrad

On 4/20/07, john lee [EMAIL PROTECTED] wrote:

what is S1 tags? i still use struts 1.3.8.


Struts 1.x. S2 would be Struts 2.x. So, with 1.3.8, you are still using S1.


  So, no possible to submit formay array?

 possible for me to implement the following code?
  for (i=1:i {
response.Write( styleId=+i);
response.Write( value=+i);
response.Write();
response.Write();
}
   %

 but, how to capature form(0), form(1) with
 corrsponsed part inside ActionForm ?



I think you could get the Struts tags to be interpreted if you wrapped
them in a logic:iterate/ tag or a c:forEach/ tag, rather than in a
loop in a scriptlet. I can't imagine how it would work beyond that,
though. I guess since only one form is actually posted back, you'd be
OK as long as it went to an action with a form bean that matched the
form?

If the goal is just to have multiple submit buttons on the page that
do different things, you might try another approach:

Have one html:form/ with multiple html:submit/ tags, each one
having an onclick handler e.g.,

html:submit onclick=doSubmitOne() .../

Then, in Javascript, you could alter the action of the form like this:

function doSubmitOne() {
   var form = document.forms[myForm];
   form.action += ?method=submitOne;
   form.submit();
}

Thus, the action would become sth.do?method=submitOne, and then in
your Action class you would have a form bean that could handle all the
fields from all your separate forms, and one method for each submit
button that would look at just the fields appropriate to that action.
Does that make sense?

It might not be the cleanest method, but it's not unlike something
I've used in the past.

Good luck,
David Conrad

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



Re: html:form array submit, capture inside ActionFrom question

2007-04-20 Thread john lee
David, tks for ur help.
   
  actually, my goal is to have multiple submit button on same page, do same 
thing, but carry different input value(different search result).
   
  john

David Conrad [EMAIL PROTECTED] wrote:
  On 4/20/07, john lee wrote:
 what is S1 tags? i still use struts 1.3.8.

Struts 1.x. S2 would be Struts 2.x. So, with 1.3.8, you are still using S1.

 So, no possible to submit formay array?

  possible for me to implement the following code?
   for (i=1:i {
  response.Write( styleId=+i);
  response.Write( value=+i);
  response.Write();
  response.Write();
  }
  %
 
  but, how to capature form(0), form(1) with
  corrsponsed part inside ActionForm ?


I think you could get the Struts tags to be interpreted if you wrapped
them in a tag or a tag, rather than in a
loop in a scriptlet. I can't imagine how it would work beyond that,
though. I guess since only one form is actually posted back, you'd be
OK as long as it went to an action with a form bean that matched the
form?

If the goal is just to have multiple submit buttons on the page that
do different things, you might try another approach:

Have one with multiple tags, each one
having an onclick handler e.g.,



Then, in Javascript, you could alter the action of the form like this:

function doSubmitOne() {
var form = document.forms[myForm];
form.action += ?method=submitOne;
form.submit();
}

Thus, the action would become sth.do?method=submitOne, and then in
your Action class you would have a form bean that could handle all the
fields from all your separate forms, and one method for each submit
button that would look at just the fields appropriate to that action.
Does that make sense?

It might not be the cleanest method, but it's not unlike something
I've used in the past.

Good luck,
David Conrad

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



   
-
Ahhh...imagining that irresistible new car smell?
 Check outnew cars at Yahoo! Autos.

Re: html:form action mapping

2006-12-07 Thread chuanjiang lo

On 12/7/06, chuanjiang lo [EMAIL PROTECTED] wrote:


Hi all

i have this jsp page with a form

html:form action=admin-console/engine-path/EditEnginePathAction

and the corresponding mapping in the struts config is

action path=/admin-console/engine-path/EditEnginePathAction
type=adminconsole.editconfig.EditEnginePathAction
name=EnginePathPropertiesForm
forward name=success  path=.admin-console.editEnginePath/
/action


When i view the source code of the jsp
it shows

form name
=EnginePathPropertiesForm method=post action=
/Jcacani

Why is the action mapping to my context path?

Appreciate any advice




found the error
mess up some mappings in  web.xml hence causing this problem.


Re: html:form without writing a form in the resultant HTML

2006-11-10 Thread Wendy Smoak

On 11/10/06, Lance Semmens [EMAIL PROTECTED] wrote:

1. Can I use struts tags (eg html:select) without wrapping them in an 
html:form (I'm pretty sure the answer is no).

2. Can I wrap my tags in html:form but somehow not output form to the 
resultant HTML.

I was hoping for a render=false or similar. eg:

html:form action=/myAction render=false
html:select property=year
html:options collection=years /
/html:select
/html:form

Any other suggestions welcome.


Officially... http://struts.apache.org/1.x/struts-taglib/tlddoc/html/select.html

This tag is only valid when nested inside a form tag body.

What happens if you leave off html:form and use the 'name' attribute
of the select tag?  If the form bean (or some other bean) is in scope,
it might work.  I'd also review the code for the select tag and see
what else it expects to get from the enclosing form tag.

'name' - The attribute name of the bean whose properties are consulted
to determine which option should be pre-selected when rendering this
input field. If not specified, the bean associated with the enclosing
html:form tag is utilized.

--
Wendy

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



RE: html:form without writing a form in the resultant HTML

2006-11-10 Thread Lance Semmens
That worked a treat... thanks for the quick response.
I did a quick check with html:text / and html:checkbox / and the *hack* 
seems to work there too.

-Original Message-
From: Wendy Smoak [mailto:[EMAIL PROTECTED] 
Sent: 10 November 2006 17:08
To: Struts Users Mailing List
Subject: Re: html:form without writing a form in the resultant HTML

On 11/10/06, Lance Semmens [EMAIL PROTECTED] wrote:
 1. Can I use struts tags (eg html:select) without wrapping them in an 
 html:form (I'm pretty sure the answer is no).

 2. Can I wrap my tags in html:form but somehow not output form to the 
 resultant HTML.

 I was hoping for a render=false or similar. eg:

 html:form action=/myAction render=false
 html:select property=year
 html:options collection=years /
 /html:select
 /html:form

 Any other suggestions welcome.

Officially... http://struts.apache.org/1.x/struts-taglib/tlddoc/html/select.html

This tag is only valid when nested inside a form tag body.

What happens if you leave off html:form and use the 'name' attribute
of the select tag?  If the form bean (or some other bean) is in scope,
it might work.  I'd also review the code for the select tag and see
what else it expects to get from the enclosing form tag.

'name' - The attribute name of the bean whose properties are consulted
to determine which option should be pre-selected when rendering this
input field. If not specified, the bean associated with the enclosing
html:form tag is utilized.

-- 
Wendy

-
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: html:form problem

2006-09-21 Thread Chris Pratt

Have you tried:  html:form action=/example ...
 (*Chris*)

On 9/21/06, Roberto C. Lima Jr. [EMAIL PROTECTED] wrote:


Hi, everyone.



I have an app that will be published at internet with apache + JBoss
Server.

So, it will be published on the address above:



http://sis.enovar.com.br/ http://sis.enovar.com.br/



But the problem is that html:form writes more than just the .do thing



html:form action=example ...



becomes



form action=/sis/example.do …



So, when i submit the page, it is trying to go to

http://sis.enovar.com.br/sis/example.do

and actually I was wondering it goes to

http://sis.enovar.com.br/example.do



Does anyone have any tip to solve my problem?



I'm using struts 1.2



Thank's

--
Roberto Costa Lima Jr.
e-novar Soluções Tecnológicas
http://www.enovar.com.br/ www.enovar.com.br

+55(85) 4009-5860
+55(85) 9104-6526







Re: html:form problem

2006-09-21 Thread Adam Gordon

It looks like you might be using modules...are you?

-adam

Roberto C. Lima Jr. wrote:

Hi, everyone.

 


I have an app that will be published at internet with apache + JBoss
Server.

So, it will be published on the address above:

 


 http://sis.enovar.com.br/ http://sis.enovar.com.br/

 


But the problem is that html:form writes more than just the “.do” thing

 


html:form action=”example” ...

 


becomes

 


form action=”/sis/example.do” …

 

So, when i submit the page, it is trying to go to 


http://sis.enovar.com.br/sis/example.do

and actually I was wondering it goes to

http://sis.enovar.com.br/example.do

 


Does anyone have any tip to solve my problem?

 


I’m using struts 1.2

 


Thank’s

--
Roberto Costa Lima Jr.
e-novar Soluções Tecnológicas
 http://www.enovar.com.br/ www.enovar.com.br

+55(85) 4009-5860
+55(85) 9104-6526

 



  


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



Re: html:form / styleId in xhtml mode

2006-08-08 Thread Laurie Harper
I suspect this restriction is there to support the validator. XHTML 
mandates the use of 'id' in place of 'name' in various situations.


That said, you can still predict what the 'id' value will be; in this 
case, it will take the name of the FormBean associated with the form. So 
your AJAX calls could just use that name to reference the form.


L.

Michael Rush wrote:
I was just looking into upgrading my app from 1.2.9 to 1.3.4 and have 
run into a snag:


2006-08-01 15:33:49,911 (ERROR) InsertTag.doEndTag - ServletException in 
'/pages/site/entry.jsp': Cannot specify styleId when in XHTML mode as 
the HTML id attribute is already used to store the bean name
javax.servlet.ServletException: Cannot specify styleId when in XHTML 
mode as the HTML id attribute is already used to store the bean name


FormTag dictates that the styleId attribute cannot be set in the 
html:form tag when using xhtml mode:


   protected void renderName(StringBuffer results)
throws JspException {
if (this.isXhtml()) {
if (getStyleId() == null) {
renderAttribute(results, id, beanName);
} else {
throw new 
JspException(messages.getMessage(formTag.ignoredId));

}
} else {
renderAttribute(results, name, beanName);
renderAttribute(results, id, getStyleId());
}
}

The question is, why?

Couldn't it just as easily be done as the following?

if (this.isXhtml()) {
if (getStyleId() == null) {
renderAttribute(results, id, beanName);
} else {
renderAttribute(results, id, getStyleId());
}
}

We're using quite a bit of AJAX in our application and referring to 
document elements by id quite regularly, not to mention that stylesheets 
reference specific ids as well (i.e. all of our forms have a styleId 
attribute). Going through and renaming all of the ids of the forms 
doesn't seem very attractive. Can someone verify that it's necessary?


Thanks,
Michael



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



Re: html:form

2006-01-13 Thread Laurie Harper

Josh McDonald wrote:
styleId, reference the taglib docs: 
http://struts.apache.org/struts-doc-1.2.x/userGuide/struts-html.html#form


Ah thanks I didn't see that.


Or to generate a name= that's not based on the name of the form

bean?
 


I'm not sure why you'd want to that.


So I can have two forms that use the same form, mainly. Otherwise I
need multiple entries in the class-bean name mapping section of the
config file, which just seems unecessary to me.

Just trying to clean up this application, it's got more duplicated code
than anything I've seen in a long time.


You can apply different validation rules for the same action form by 
tying your validation to the action mapping path instead of the form, if 
that helps... In other words, instead of saying 'form X has validation 
rules Y', you can say 'action X has validation rules Y' and then use the 
same form with different actions, applying different different 
validation rules to each one.


Is that what your concern was, or are you trying to achieve something 
different?


L.


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



Re: html:form

2006-01-12 Thread Dave Newton

Josh McDonald wrote:


Quick question, is it possible to make html:form generate an id= ?
 

styleId, reference the taglib docs: 
http://struts.apache.org/struts-doc-1.2.x/userGuide/struts-html.html#form



Or to generate a name= that's not based on the name of the form bean?
 


I'm not sure why you'd want to that.


The whole setup of the html:form taglib doesn't make a lot of sense
from where I sit really :(
 

It makes sense if you're using form beans. If you're not using the 
Struts form processing stuff then no, it wouldn't.


Dave



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



Re: html:form

2006-01-12 Thread Josh McDonald
styleId, reference the taglib docs: 
http://struts.apache.org/struts-doc-1.2.x/userGuide/struts-html.html#form

Ah thanks I didn't see that.

Or to generate a name= that's not based on the name of the form
bean?
  

I'm not sure why you'd want to that.

So I can have two forms that use the same form, mainly. Otherwise I
need multiple entries in the class-bean name mapping section of the
config file, which just seems unecessary to me.

Just trying to clean up this application, it's got more duplicated code
than anything I've seen in a long time.
 
-Josh
 
-- 
 
His comrades fought beside him, Van Owen and the rest...
   But of all the thompson gunners- Roland was the best.
 
Josh McDonald
Analyst Programmer
Information Technology
Ph: 61 7 3006 6460
Email: [EMAIL PROTECTED]




***
Messages included in this e-mail and any of its attachments are those
of the author unless specifically stated to represent WorkCover Queensland. The 
contents of this message are to be used for the intended purpose only and are 
to be kept confidential at all times.
This message may contain privileged information directed only to the intended 
addressee/s. Accidental receipt of this information should be deleted promptly 
and the sender notified.
This e-mail has been scanned by Sophos for known viruses.
However, no warranty nor liability is implied in this respect.




Re: html:form dynamic action value

2005-12-12 Thread Laurie Harper

Perry Jeung wrote:

I have a html:form tag with a dynamic action value that works in one version of
Struts and not in another.

I'm new to Tiles and I want to do the following in one of the reusable tiles
named report.jsp:

html:form action=%= (String)request.getAttribute(action) % 

In an experiment, I took the struts-example webapp from the Struts 1.2.8 binary
distributon and modified the html-link.jsp like this:

%
String actionValue = /html-link-submit;
request.setAttribute(action, actionValue);
%
html:form action=%= (String)request.getAttribute(action) %


This works so I go back to my application to do the same thing
but doesn't work.  I get the following error on the html page in the browser:
[ServletException in:/tiles/report.jsp] null'

I'm using a debugger and I can see that the action attribute is defined in the
request context.

Why the difference?  Is it the struts environment?

Both are running on Tomcat 5.0.28.

My app uses Struts 1.1 and has this preamble in web.xml

!DOCTYPE web-app
  PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.2//EN
  http://java.sun.com/j2ee/dtds/web-app_2_2.dtd;

The modified struts-example is from Struts 1.2.8 and has the same web.xml
preamble as above.

Would I be right in concluding that the difference is in the Struts version and
that upgrading would solve my problem?
My app has close to 100 pages, so before I start, can anybody offer some
insight as to the root of the problem.


Have you tried your experiment using the examples app from Struts 1.1? 
That might be a useful sanity check before drawing any conclusions. I 
can't offer any insight into the error you're getting without seeing the 
full stacktrace (if then! :-)


L.


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



Re: html:form not generating name= attribute

2005-08-22 Thread Haroon Rafique
On Saturday at 9:36am, DB=Don Brown [EMAIL PROTECTED] wrote:

DB Ok, I looked at the 1.2.7 source, and indeed, it doesn't generate an 
DB id orname if xhtml mode is on.  You are correct, the styleId is a 
DB good workaround, especially if you use the commons-validator checked 
DB out from trunk.
DB 
DB Don

This is fixed in subverion: 
http://issues.apache.org/bugzilla/show_bug.cgi?id=35127
and needs to be used with commons validator (latest subversion as well).

--
Haroon Rafique
[EMAIL PROTECTED]


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



Re: html:form not generating name= attribute

2005-08-20 Thread Morris Jones

Don Brown wrote:
 You probably enabled xhtml output rendering, which renders an id
 attribute instead.  Unfortunately, client-side validation in xhtml is
 currently broken in Struts 1.2.7, so you can either checkout and build
 commons-validator or wait until the next release.

Thanks Don, yes I enabled xhtml.  Interestingly, it's not generating an 
id attribute either, so there must be another trigger, like having an 
entry for the from in the validation.xml file (which I don't have). 
Perhaps I can use the styleId attribute on html:form to get a handle 
on a form.


Today my app is failing at startup when the Validation plug-in reads its 
config xml files, unexpected end of file.  Yet the XML files have 
nothing in them at this point -- they're just copied from struts-blank. 
 So something odd is going on.


Just another odd puzzle ...

I probably will checkout and build commons-validator.

Cheers,
Mojo
--
Morris Jones
Monrovia, CA
http://www.whiteoaks.com
Old Town Astronomers: http://www.otastro.org

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



Re: html:form not generating name= attribute

2005-08-19 Thread Don Brown
You probably enabled xhtml output rendering, which renders an id
attribute instead.  Unfortunately, client-side validation in xhtml is
currently broken in Struts 1.2.7, so you can either checkout and build
commons-validator or wait until the next release.

Don

On 8/19/05, Morris Jones [EMAIL PROTECTED] wrote:
 This is an odd problem I haven't run into before ...
 
 The form tags in my HTML are coming out without a name=formName
 attribute.
 
 I haven't yet looked at the source code for the html:form tag to see
 what might cause the name attribute to be excluded, but I've triple
 checked my struts-config to be sure there's a name=... attribute in
 the action element, and that the path and the tags all match.
 
 I hadn't needed to reference a form until I'd written several forms in
 this current app.  All my other forms are working fine, but none of my
 forms have the name= attribute in the form element of the HTML.
 
 This is my first application mapped by path instead of extension, if
 that makes a difference.  I found it odd that extension mapping had to
 use the form html:form action=/action.do but in the path mapping, I
 don't use html:form action=/do/action.  Something seems disconnected
 here.
 
 Thoughts very much appreciated!
 
 Mojo
 --
 Morris Jones
 Monrovia, CA
 http://www.whiteoaks.com
 Old Town Astronomers: http://www.otastro.org
 
 -
 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: html:form action

2005-03-17 Thread Rajaneesh
xls is a predefined mime type for excel spread sheet. It may create a
problem.

while defining the extensions you need to map this to ActionServlet in
web.xml

-Original Message-
From: Mili Aggarwal, Noida [mailto:[EMAIL PROTECTED]
Sent: Friday, March 18, 2005 9:47 AM
To: Struts Users Mailing List
Subject: html:form action


Hello All,

Can I have action form mapping as :

html:form action=/viewReport/abc.xls  /

And the corresponding entry in struts config as:

action path=/viewReport/*.xls type=com.hcl.sme.action.ViewReportAction
name=ViewReportForm input=/pages/report.jsp scope=request



Warm Regards,
Mili Aggarwal
HCL TECHNOLOGIES LTD.
Noida, India.
Tel: +91 (0120) 2516321/328 Extn: 1034
Email: [EMAIL PROTECTED]


-DISCLAIMER-

-

This message and any attachment(s) contained here are information that is
confidential, proprietary to HCL Technologies and its customers. Contents
may be privileged or otherwise protected by law. The information is solely
intended for the individual or the entity it is addressed to. If you are not
the intended recipient of this message, you are not authorized to read,
forward, print, retain, copy or disseminate this message or any part of it.
If you have received this e-mail in error, please notify the sender
immediately by return e-mail and delete it from your computer.





Disclaimer:

This message and any attachment(s) contained here are information that is
confidential,proprietary to HCL Technologies and its customers, privileged
or otherwise protected by law.The information is solely intended for the
individual or the entity it is addressed to. If you are not the intended
recipient of this message, you are not authorized to read, forward,
print,retain, copy or disseminate this message or any part of it. If you
have received this e-mail in error, please notify the sender immediately by
return e-mail and delete it from your computer.




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



RE: html:form action

2005-03-17 Thread Mili Aggarwal, Noida


Hello,

Will this do?

html:form action=/viewReport/abc   /

And the corresponding entry in struts config as:

action path=/viewReport/* type=com.hcl.sme.action.ViewReportAction
name=ViewReportForm input=/pages/report.jsp scope=request

Warm Regards,
Mili Aggarwal


-DISCLAIMER-

-

This message and any attachment(s) contained here are information that is
confidential, proprietary to HCL Technologies and its customers. Contents
may be privileged or otherwise protected by law. The information is solely
intended for the individual or the entity it is addressed to. If you are not
the intended recipient of this message, you are not authorized to read,
forward, print, retain, copy or disseminate this message or any part of it.
If you have received this e-mail in error, please notify the sender
immediately by return e-mail and delete it from your computer.




-Original Message-
From: Rajaneesh [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 18, 2005 9:58 AM
To: 'Struts Users Mailing List'
Subject: RE: html:form action

xls is a predefined mime type for excel spread sheet. It may create a
problem.

while defining the extensions you need to map this to ActionServlet in
web.xml

-Original Message-
From: Mili Aggarwal, Noida [mailto:[EMAIL PROTECTED]
Sent: Friday, March 18, 2005 9:47 AM
To: Struts Users Mailing List
Subject: html:form action


Hello All,

Can I have action form mapping as :

html:form action=/viewReport/abc.xls  /

And the corresponding entry in struts config as:

action path=/viewReport/*.xls type=com.hcl.sme.action.ViewReportAction
name=ViewReportForm input=/pages/report.jsp scope=request



Warm Regards,
Mili Aggarwal
HCL TECHNOLOGIES LTD.
Noida, India.
Tel: +91 (0120) 2516321/328 Extn: 1034
Email: [EMAIL PROTECTED]


-DISCLAIMER-

-

This message and any attachment(s) contained here are information that is
confidential, proprietary to HCL Technologies and its customers. Contents
may be privileged or otherwise protected by law. The information is solely
intended for the individual or the entity it is addressed to. If you are not
the intended recipient of this message, you are not authorized to read,
forward, print, retain, copy or disseminate this message or any part of it.
If you have received this e-mail in error, please notify the sender
immediately by return e-mail and delete it from your computer.





Disclaimer:

This message and any attachment(s) contained here are information that is
confidential,proprietary to HCL Technologies and its customers, privileged
or otherwise protected by law.The information is solely intended for the
individual or the entity it is addressed to. If you are not the intended
recipient of this message, you are not authorized to read, forward,
print,retain, copy or disseminate this message or any part of it. If you
have received this e-mail in error, please notify the sender immediately by
return e-mail and delete it from your computer.




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


Disclaimer: 

This message and any attachment(s) contained here are information that is
confidential,proprietary to HCL Technologies and its customers, privileged
or otherwise protected by law.The information is solely intended for the
individual or the entity it is addressed to. If you are not the intended
recipient of this message, you are not authorized to read, forward,
print,retain, copy or disseminate this message or any part of it. If you
have received this e-mail in error, please notify the sender immediately by
return e-mail and delete it from your computer.



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



Re: html:form question

2005-03-11 Thread Erik Weber
Scott Purcell wrote:
Hello,
I have a login that I call and displays its initial presentation. I am using the html:form 
action=login.do line for when I submit its values.
But I want to put in some default values into the initial presentation. So upon reading about
html:form it looks like I could use the following:
html:form action=login.do name=loginBean type=com.ddi.dealer.bean.LoginForm
 

I think the name and type attributes to html:form were deprecated at 1.1 
and now no longer exist.

Because in my struts-config.xml I have the following two sections
 form-beans
   form-bean name=loginBean type=com.ddi.dealer.bean.LoginForm /
 /form-beans
 action
   path=/login
   input=/jsp/login.jsp
   type=com.ddi.dealer.action.LoginAction
   name=loginBean
   scope=request
   validate=true
   forward name=Success path=/jsp/welcome.jsp /
   forward name=Failure path=/jsp/login.jsp /
 /action
So I was hoping that that form line would call, create new loginBean and show the data in my initial feed.
 

I'm not sure I know exactly what you are trying to do. But it sounds 
like you are trying to do what I would do in a standard setup 
Action/form processing Action pairing. I would have an Action that 
switches on the action mapping's parameter attribute. Two action 
mappings, same Action. One mapping would have parameter=viewLogin, the 
other parameter=doLogin. Both would name the form bean to 
instantiate/use, but the view mapping has validation turned off while 
the do mapping has validation turned on. Struts has various 
dispatch-type Actions that do this stuff more automatically but 
switching on a parameter works for me.

In the Action, if I'm processing viewLogin, and I want default values, 
I invoke a populateForm method, passing 1) the form 2) a value object 
(presumably obtained from the model) used to set initial values.

Hope that helps.
Erik

The submitting is good, It was just something I am not understanding.
Anyone know why that does not work?
Thanks,
Scott
 

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


RE: html:form complains of bean missing

2005-03-02 Thread Scott Purcell
Hello Gunther,

I read last night about the tiles tempating functionality, so I have a little 
better handle on it today. It actually is a nice way to create some parts of my 
app, so I will revisit it today and try and prototype a couple of pages 
together. But as far as handling the session expires, etc, I do not completely 
understand how this is accomplished.

What I have today, is a extended Action class which I can call a method eg: if 
(obj.isLoggedIn()) {  type of method. So each of my pages has to go to the 
action servlet.

Anyway, if you could show me how you are handling this, or be a litle more 
precise that would really help me out.

I sincerely appreciate your time,
Scott




-Original Message-
From: Günther Wieser [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 01, 2005 12:40 PM
To: 'Struts Users Mailing List'
Subject: RE: html:form complains of bean missing


hi 

if you want a single point where you can check if a user is logged in or
not, you can do something like the following:
create a class MyRequestProcessor extends TilesRequestProcessor (in this
case it is because i use tiles) and implement the process() method.
within this method check for the login var that you e.g. put into the
session.
in the struts-config.xml add 
controller
processorClass=com.creative_it.webcreator.strutsext.MyRequestProcessor /
and everythings fine.
what you need to do in the MyReqestProcessor class is to exclude all URLs
from checking that are used for e.g. the login form, or an error message in
case something went wrong.
if you want to be very nice to your users, store the URL that the user
requested in the session, than redirect to the login form, and if everything
went fine with the login, send him to the page that he/she originally
requested.

if you want the code for this, let me know, i can provide it.

kr,
guenther

-Original Message-
From: Scott Purcell [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 01, 2005 7:17 PM
To: user@struts.apache.org
Subject: html:form complains of bean missing

First off, as I am learning Struts I just wanted to thank those, for bearing
with my learning curve and helping out so far.
 
Here is the issue:
I want to pass all my forms, even forms without params to the
com.skp.action.LoginAction action class, because this class handles the
isLoggedIn issue through a subclass of Action.
 
Anyway, I have a jsp page that has no params, so I have no bean to collect
user data, so I configured my action like so:
action  path=/mainAdmin
type=com.skp.action.LoginAction 
 forward name=Success path=/jsp/admin/main.jsp redirect=true/
  /action
 
Anyway, I just want to always use the LoginAction as a Front Controller to
my web app, and catch the status of logged-in etc.
This works well, but I have to use conventional html code and not the
html:form tag:
 
works:
!-- form name=foo action=/uniquepear/action/mainAdmin method=POST
-- does not work:
html:form action=mainAdmin
 
When I use the above I get this error in the browser:
javax.servlet.ServletException: Cannot retrieve definition for form bean
null at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp
l.java:495)
at org.apache.jsp.main_jsp._jspService(main_jsp.java:175)

 
But I have no reason to have  a bean for this action.
How does one handle this problem?
 
Thanks
Scott
 
 
 
 
 



-
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: html:form complains of bean missing

2005-03-02 Thread Günther Wieser
hi scott,

well, i'll try my best.
here's the code from the execute method of MyRequestProcessor (that's the
one included in the struts-config.xml):

public class MyRequestProcessor extends TilesRequestProcessor {

public void process(HttpServletRequest req, HttpServletResponse res)
throws IOException, ServletException {
HttpSession session = req.getSession();
String path = super.processPath(req, res);
String url = req.getRequestURL().toString();
String queryString = req.getQueryString();
// the next lines are there to allow deep linking
// we store the url that has been requested for future use
if ((queryString!=null)  (!.equals(queryString))) {
url = url + ? + queryString;
}
if (session.getAttribute(Constants.SESSION_LOGIN_REFER_KEY)
== null) {
if (url != null) {

session.setAttribute(Constants.SESSION_LOGIN_REFER_KEY, url);
}
else {
//TODO: get main URL from property

session.setAttribute(Constants.SESSION_LOGIN_REFER_KEY,
http://localhost:8080/WebCreator/index.do;);
}
}
// no comes the important stuff
if (!checkForRealm(session)) {
if (!/login.equals(path)) {
super.doForward(/login.do, req, res);
}
}
super.process(req, res);
}

protected boolean checkForRealm(HttpSession session)
throws ServletException, IOException {
if (session.getAttribute(Constants.SESSION_USER_KEY) != null
) {
return true;
}
else {
return false;
}
}
}

so what it does is:
- get the current requested url for further reference and stores it in the
session if an atrribute with the same key does not exist (see deep linking
below)
- then it checks the session for the realm (that is the attribute that you
use to say the user is logged in)
- if it does not exist and if the request didn't go to /login.do, it
forwards the request to the action /login.do (which is a simple html with
username/password field)
- if it exists it redirects to the super class to process the request as
usual
- you need to implement the checkRealm() method with whatever you need to
check, my example is really simple but very common

with extending TileRequestProcessor (don't care that i extend
TilesRequestProcessor, you can extend the standard request processor the
same way) and adding the lines in struts-config.xml, each request that hits
the struts action servlet will go through MyRequestProcessor BEFORE the
typical struts tasks (action, form beans filling, etc) start. so this is the
right place to check security, authorization and authentication.

regarding deep linking: i want my customers to be able to store a bookmark
that points deep into the system. when they request this bookmark, they of
course need to login first. so i store the requested url in the session, and
if the login is successfull, i send a redirect to the browser to disply the
page the user requested with his bookmark.
this is done by sending a meta refresh command in the head of the resulting
login ok page, with the url containing the session attribute that has been
store with session.setAttribute(Constants.SESSION_LOGIN_REFER_KEY, url)

hope that helps, feel free to ask more if something is unclear.

kr,
guenther
--
Günther Wieser

creative-it
Guglgasse 6/1/11/1
A-1110 Wien
Austria
http://www.creative-it.com


-Original Message-
From: Scott Purcell [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 02, 2005 3:07 PM
To: Struts Users Mailing List
Subject: RE: html:form complains of bean missing

Hello Gunther,

I read last night about the tiles tempating functionality, so I have a
little better handle on it today. It actually is a nice way to create some
parts of my app, so I will revisit it today and try and prototype a couple
of pages together. But as far as handling the session expires, etc, I do not
completely understand how this is accomplished.

What I have today, is a extended Action class which I can call a method eg:
if (obj.isLoggedIn()) {  type of method. So each of my pages has to go to
the action servlet.

Anyway, if you could show me how you are handling this, or be a litle more
precise that would really help me out.

I sincerely appreciate your time,
Scott




-Original Message-
From: Günther Wieser [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 01, 2005 12:40 PM
To: 'Struts Users Mailing List'
Subject: RE: html:form complains of bean missing


hi 

if you want a single point where you can check if a user is logged in or
not, you

Re: html:form complains of bean missing

2005-03-02 Thread Bill Siggelkow
Gunther,
Is there a reason you didn't do this using a servlet filter instead of 
a custom request processor? IMO, servlet filters are less intrusive, 
support filtering for JSPs and static pages as well as Struts actions, 
and its easier to selectively apply them using URL patterns.

Also, I noticed that overrode the process method calling 
super.process() at the end. I think it would have been better to 
override processPreprocess() -- that's what its designed for.

-Bill Siggelkow
On 2005-03-02 09:52:49 -0500, =?iso-8859-1?Q?G=FCnther_Wieser?= 
[EMAIL PROTECTED] said:

hi scott,
well, i'll try my best.
here's the code from the execute method of MyRequestProcessor (that's  the
one included in the struts-config.xml):
public class MyRequestProcessor extends TilesRequestProcessor {
public void process(HttpServletRequest req, HttpServletResponse res)
throws IOException, ServletException {
HttpSession session = req.getSession();
String path = super.processPath(req, res);
String url = req.getRequestURL().toString();
String queryString = req.getQueryString();
// the next lines are there to allow deep linking
// we store the url that has been requested for future use
if ((queryString!=null)  (!.equals(queryString))) {
url = url + ? + queryString;
}
if (session.getAttribute(Constants.SESSION_LOGIN_REFER_KEY)
== null) {
if (url != null) {

session.setAttribute(Constants.SESSION_LOGIN_REFER_KEY, url);
}
else {
//TODO: get main URL from property

session.setAttribute(Constants.SESSION_LOGIN_REFER_KEY,
http://localhost:8080/WebCreator/index.do;);
}
}
// no comes the important stuff
if (!checkForRealm(session)) {
if (!/login.equals(path)) {
super.doForward(/login.do, req, res);
}
}
super.process(req, res);
}
protected boolean checkForRealm(HttpSession session)
throws ServletException, IOException {
if (session.getAttribute(Constants.SESSION_USER_KEY) != null
) {
return true;
}
else {
return false;
}
}
}
so what it does is:
- get the current requested url for further reference and stores it in  the
session if an atrribute with the same key does not exist (see deep  linking
below)
- then it checks the session for the realm (that is the attribute that  you
use to say the user is logged in)
- if it does not exist and if the request didn't go to /login.do, it
forwards the request to the action /login.do (which is a simple html  with
username/password field)
- if it exists it redirects to the super class to process the request as
usual
- you need to implement the checkRealm() method with whatever you need  to
check, my example is really simple but very common
with extending TileRequestProcessor (don't care that i extend
TilesRequestProcessor, you can extend the standard request processor the
same way) and adding the lines in struts-config.xml, each request that  hits
the struts action servlet will go through MyRequestProcessor BEFORE the
typical struts tasks (action, form beans filling, etc) start. so this is  the
right place to check security, authorization and authentication.
regarding deep linking: i want my customers to be able to store a  bookmark
that points deep into the system. when they request this bookmark, they  of
course need to login first. so i store the requested url in the session,  and
if the login is successfull, i send a redirect to the browser to disply  the
page the user requested with his bookmark.
this is done by sending a meta refresh command in the head of the  resulting
login ok page, with the url containing the session attribute that has  been
store with session.setAttribute(Constants.SESSION_LOGIN_REFER_KEY,  url)
hope that helps, feel free to ask more if something is unclear.
kr,
guenther


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


RE: html:form complains of bean missing

2005-03-01 Thread Günther Wieser
hi 

if you want a single point where you can check if a user is logged in or
not, you can do something like the following:
create a class MyRequestProcessor extends TilesRequestProcessor (in this
case it is because i use tiles) and implement the process() method.
within this method check for the login var that you e.g. put into the
session.
in the struts-config.xml add 
controller
processorClass=com.creative_it.webcreator.strutsext.MyRequestProcessor /
and everythings fine.
what you need to do in the MyReqestProcessor class is to exclude all URLs
from checking that are used for e.g. the login form, or an error message in
case something went wrong.
if you want to be very nice to your users, store the URL that the user
requested in the session, than redirect to the login form, and if everything
went fine with the login, send him to the page that he/she originally
requested.

if you want the code for this, let me know, i can provide it.

kr,
guenther

-Original Message-
From: Scott Purcell [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 01, 2005 7:17 PM
To: user@struts.apache.org
Subject: html:form complains of bean missing

First off, as I am learning Struts I just wanted to thank those, for bearing
with my learning curve and helping out so far.
 
Here is the issue:
I want to pass all my forms, even forms without params to the
com.skp.action.LoginAction action class, because this class handles the
isLoggedIn issue through a subclass of Action.
 
Anyway, I have a jsp page that has no params, so I have no bean to collect
user data, so I configured my action like so:
action  path=/mainAdmin
type=com.skp.action.LoginAction 
 forward name=Success path=/jsp/admin/main.jsp redirect=true/
  /action
 
Anyway, I just want to always use the LoginAction as a Front Controller to
my web app, and catch the status of logged-in etc.
This works well, but I have to use conventional html code and not the
html:form tag:
 
works:
!-- form name=foo action=/uniquepear/action/mainAdmin method=POST
-- does not work:
html:form action=mainAdmin
 
When I use the above I get this error in the browser:
javax.servlet.ServletException: Cannot retrieve definition for form bean
null at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp
l.java:495)
at org.apache.jsp.main_jsp._jspService(main_jsp.java:175)

 
But I have no reason to have  a bean for this action.
How does one handle this problem?
 
Thanks
Scott
 
 
 
 
 



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



Re: html:form complains of bean missing

2005-03-01 Thread Curtis Taylor
Hi Scott,
If you choose to use the Struts html:form tag, you must declare the 
corresponding definition in the form:beans section of the struts-config 
file. That's the way the framework behaves as I've used it.

HTH,
-- Curtis
Scott Purcell wrote:
First off, as I am learning Struts I just wanted to thank those, for bearing with my learning curve and helping out so far.
 
Here is the issue:
I want to pass all my forms, even forms without params to the com.skp.action.LoginAction action class, because this class handles the isLoggedIn issue through a subclass of Action.
 
Anyway, I have a jsp page that has no params, so I have no bean to collect user data, so I configured my action like so:
action  path=/mainAdmin
type=com.skp.action.LoginAction 
 forward name=Success path=/jsp/admin/main.jsp redirect=true/
  /action
 
Anyway, I just want to always use the LoginAction as a Front Controller to my web app, and catch the status of logged-in etc.
This works well, but I have to use conventional html code and not the html:form tag:
 
works:
!-- form name=foo action=/uniquepear/action/mainAdmin method=POST --
does not work:
html:form action=mainAdmin
 
When I use the above I get this error in the browser:
javax.servlet.ServletException: Cannot retrieve definition for form bean null
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:495)
at org.apache.jsp.main_jsp._jspService(main_jsp.java:175)

 
But I have no reason to have  a bean for this action.
How does one handle this problem?
 
Thanks
Scott
 
 
 
 
 


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


Re: html:form action getting altered after validation

2005-01-27 Thread Kishore Senji
On Fri, 28 Jan 2005 13:22:32 +1300, Stephen Souness [EMAIL PROTECTED] wrote:
 Hi all,
 
 I have a fairly simple form like so:
 
 html:form action=/someProcess.do
   html:text property=username /
 /html:form
 
 When the input fails validation and the user is sent back to the form
 the action is changed to //someProcess.do - is this familiar to
 anyone?  What am I missing?
 

If I had to take a wild guess, I think you have declared your
struts-config.xml with a param-name config/ instead of just config
(Note the no slash) which lets Struts create two modules one with
prefix  (empty string) and another with a prefix (/) which I guess
causes the // problem.

If you have infact declared it as config/ then removing the slash
should solve the problem.


 This is with struts 1.2.4
 
 --
 Stephen
 
 -
 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: html:form action getting altered after validation

2005-01-27 Thread Stephen Souness
Did a little more digging around and found a bugzilla entry - fixed in 
1.2.6 (beta)

http://issues.apache.org/bugzilla/show_bug.cgi?id=32283
--
Stephen

Kishore Senji wrote:
On Fri, 28 Jan 2005 13:22:32 +1300, Stephen Souness [EMAIL PROTECTED] wrote:
Hi all,
I have a fairly simple form like so:
html:form action=/someProcess.do
 html:text property=username /
/html:form
When the input fails validation and the user is sent back to the form
the action is changed to //someProcess.do - is this familiar to
anyone?  What am I missing?

If I had to take a wild guess, I think you have declared your
struts-config.xml with a param-name config/ instead of just config
(Note the no slash) which lets Struts create two modules one with
prefix  (empty string) and another with a prefix (/) which I guess
causes the // problem.
If you have infact declared it as config/ then removing the slash
should solve the problem.

This is with struts 1.2.4
--
Stephen
-
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: html:form action=... - Newbie

2004-12-03 Thread Bill Siggelkow
The reason is that in classical HTML; forms are expected to accept 
input. Struts stores the input data in an ActionForm; the traditional 
approach for what you are doing would be to use a link and not a button.

-Bill Siggelkow
Jacques wrote:
Hi,
Here's what I want to achieve :
I have a form (call it INPUT).  Let's say the form's action is ActionA.do.
ActionA.do is mapped to com.mycompany.myclass, which can either forward to
success or failure.  In struts-config.xml, success is mapped to
ActionB.do, and I want failure to be mapped to a simple JSP error page,
call it failure.jsp.  In other words, I don't want to re-display INPUT
with errors (html:errors) : I want a completely different page, because it
doesn't make sense in my application to re-display the INPUT form when this
error occurs.
In failure.jsp, I want to display the error message, and have a button that,
when clicked, will return the user to some other page, mapped to
ActionStart.do.
So, I thought I would use the following struts tag : html:form
action=ActionStart.do in that error page.
When I try the application, and the failure condition is triggered, I get
the following error message :
2004-12-03 13:27:20 StandardWrapperValve[action]: Servlet.service() for
servlet action threw exception
org.apache.jasper.JasperException: Cannot retrieve definition for form bean
null
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2
54)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
...
My fix for this error was to forget about the struts html:form... tag,
and just use HTML's form... instead.
Although this worked, I would love to have an explanation as to why I got
the error mentionned, and maybe some workaround that would let me use
html:form...
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.802 / Virus Database: 545 - Release Date: 11/26/2004

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


Re: html:form action=... - Newbie

2004-12-03 Thread Wendy Smoak
From: Jacques [EMAIL PROTECTED]
 When I try the application, and the failure condition is triggered, I get
 the following error message :

 2004-12-03 13:27:20 StandardWrapperValve[action]: Servlet.service() for
 servlet action threw exception
 org.apache.jasper.JasperException: Cannot retrieve definition for form
bean
 null

Rather than make up names, it's a lot easier if you just use the real names
of the forms and classes you're working on.

That error means that Struts can't figure out what form bean you want it to
use.  You probably left out the name=formName attribute, probably in the
action tag in struts-config.xml.  Post your actual config information
[just the action tag] and some of your JSP code, and someone will probably
spot the error.

-- 
Wendy Smoak


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



RE: [BULK] - Re: html:form action=... - Newbie

2004-12-03 Thread Harrison Tsang


-Original Message-
From: Wendy Smoak [mailto:[EMAIL PROTECTED] 
Sent: Friday, December 03, 2004 11:31 AM
To: Struts Users Mailing List
Subject: [BULK] - Re: html:form action=... - Newbie

From: Jacques [EMAIL PROTECTED]
 When I try the application, and the failure condition is triggered, I
get
 the following error message :

 2004-12-03 13:27:20 StandardWrapperValve[action]: Servlet.service()
for
 servlet action threw exception
 org.apache.jasper.JasperException: Cannot retrieve definition for form
bean
 null

Rather than make up names, it's a lot easier if you just use the real
names
of the forms and classes you're working on.

That error means that Struts can't figure out what form bean you want it
to
use.  You probably left out the name=formName attribute, probably in
the
action tag in struts-config.xml.  Post your actual config information
[just the action tag] and some of your JSP code, and someone will
probably
spot the error.

-- 
Wendy Smoak


-
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: html:form : pre-populating fields from the Action java code

2004-10-25 Thread Bill Keese
Thanks.  Yes, I can reference the bean name from every html:text or 
other element inside of the html:form.  But if there are lots of 
fields,  it would be nicer to only write the bean name once, in the 
html:form tag.

Luis Gervaso wrote:
You can use 3 differents FlightBean and then populate the *value
attribute* in each html:text/
When you click only one form submit is sent
Luis Gervaso
On Fri, 22 Oct 2004 15:28:16 +0900, Bill Keese
[EMAIL PROTECTED] wrote:
 

I have a question about pre-populating the fields of a form you display
in the browser. To pre-populate fields, the Action saves a Form bean in
the context via request.setAttribute(inputForm, inputForm), and
html:form tag looks up the form bean.
html:form determines the form bean's name automatically based on the
specified action and the settings in struts-config.xml. But, what if you
wanted a web page with multiple forms all pointing at the same action?
For example, an airline ticket website might display 10 possible flights
and have a button to book each flight. All the buttons point at the same
bookFlight action, but the flight number attribute is different.
In other words, how do I implement the code below without using the
name (or beanName) attribute:
MyAction.java:
request.setAttribute(inputForm1, new InputForm($499, flight 31));
request.setAttribute(inputForm2, new InputForm($599, flight 32));
request.setAttribute(inputForm3, new InputForm($699, flight 33));
MyPage.jsp:
html:form beanName=inputForm1 action=bookFlight.do
html:button ... /
/html:form
html:form beanName=inputForm2 action=bookFlight.do
html:button ... /
/html:form
html:form beanName=inputForm3 action=bookFlight.do
html:button ... /
/html:form
Bill
-
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: html:form doesn't return action

2004-10-25 Thread Bill Siggelkow
I don't know if this is a cut-and-paste error but you are missing a '' 
in your action mapping after ' parameter=method '

Carl F. Hall wrote:
Whenever I use html:form, I only get the name of the context as the action.
What would cause the action to not return correctly?  See below for my
specific case.  Thank you in advance for any help.
This code:
html:form action=/ManageAgent
Returns this:
form name=agentForm method=post action=/
My ActionMapping for is:
action
path=/ManageAgent
type=com.crownga.actions.AgentAction
scope=request
name=agentForm
input=/admin/ManageAgent.jsp
parameter=method
forward
name=editSuccess
path=/admin/ManageAgent.jsp /
forward
name=success
path=/ListAgents.do?method=listAll
redirect=true /
forward
name=failure
path=/admin/ManageAgent.jsp /
/action
 
Carl F. Hall
[EMAIL PROTECTED]

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


Re: html:form : pre-populating fields from the Action java code

2004-10-22 Thread Luis Gervaso
You can use 3 differents FlightBean and then populate the *value
attribute* in each html:text/
When you click only one form submit is sent

Luis Gervaso


On Fri, 22 Oct 2004 15:28:16 +0900, Bill Keese
[EMAIL PROTECTED] wrote:
 I have a question about pre-populating the fields of a form you display
 in the browser. To pre-populate fields, the Action saves a Form bean in
 the context via request.setAttribute(inputForm, inputForm), and
 html:form tag looks up the form bean.
 
 html:form determines the form bean's name automatically based on the
 specified action and the settings in struts-config.xml. But, what if you
 wanted a web page with multiple forms all pointing at the same action?
 For example, an airline ticket website might display 10 possible flights
 and have a button to book each flight. All the buttons point at the same
 bookFlight action, but the flight number attribute is different.
 
 In other words, how do I implement the code below without using the
 name (or beanName) attribute:
 
 MyAction.java:
 request.setAttribute(inputForm1, new InputForm($499, flight 31));
 request.setAttribute(inputForm2, new InputForm($599, flight 32));
 request.setAttribute(inputForm3, new InputForm($699, flight 33));
 
 MyPage.jsp:
 html:form beanName=inputForm1 action=bookFlight.do
 html:button ... /
 /html:form
 html:form beanName=inputForm2 action=bookFlight.do
 html:button ... /
 /html:form
 html:form beanName=inputForm3 action=bookFlight.do
 html:button ... /
 /html:form
 
 Bill
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


-- 
Un saludo

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



Re: html:form and modules

2004-09-16 Thread Ricardo Gladwell
Hi,
Thanks for that, I will try to use the switch action to forward onto the 
correct module actions. Just out of interest, why doesn't the html:form 
tag have a module attribute?

Yves Sy wrote:
Try using SwitchAction
-Regards-
Yves
On Wed, 15 Sep 2004 23:46:16 +0100, Ricardo Gladwell
[EMAIL PROTECTED] wrote:
Hi,
I'm experimenting with struts modules, but I've encountered a problem
whereby I have a struts html:form referencing an action in my
non-default module. Instead of referencing the correct action, I get a
Cannot retrieve mapping for action JspException.
How do I reference an action in another module from a html:form? Unlike
html:link there doesn't seem to be a module attribute?
Kind regards...
--
Ricardo Gladwell
-
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: html:form and modules

2004-09-16 Thread Yves Sy
I would guess its because its not really standard practice to submit a
form to a handler from another module. It's kind of a weird flow if
you ask me. Usually you'd submit to a handler in your own module and
THEN forward to wherever else using SwitchAction.

Anyway if the SwitchAction does not work, you can go the usual
javascript way of dynamically changing the action attribute's value...

% String url = response.encodeURL(request.getContextPath() +
/another-module/myAction.do); %
document.myForm.action = '%= url%';
document.myFormsubmit();

Not very elegant but it works.

Regards,
-Yves-

On Thu, 16 Sep 2004 09:30:09 +0100, Ricardo Gladwell
[EMAIL PROTECTED] wrote:
 Hi,
 
 Thanks for that, I will try to use the switch action to forward onto the
 correct module actions. Just out of interest, why doesn't the html:form
 tag have a module attribute?
 
 Yves Sy wrote:
  Try using SwitchAction
 
  -Regards-
  Yves
 
 
  On Wed, 15 Sep 2004 23:46:16 +0100, Ricardo Gladwell
  [EMAIL PROTECTED] wrote:
 
 Hi,
 
 I'm experimenting with struts modules, but I've encountered a problem
 whereby I have a struts html:form referencing an action in my
 non-default module. Instead of referencing the correct action, I get a
 Cannot retrieve mapping for action JspException.
 
 How do I reference an action in another module from a html:form? Unlike
 html:link there doesn't seem to be a module attribute?
 
 Kind regards...
 
 --
 Ricardo Gladwell
 
 -
 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]
 
 



-- 
For me to poop on!
http://www.formetopoopon.com
http://www.nbc.com/nbc/Late_Night_with_Conan_O'Brien/video/triumph.shtml

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



Re: html:form and modules

2004-09-16 Thread Ricardo Gladwell
Hi,
Perhaps I'm misunderstandig the use of modules: I have a default module 
that handles basic webapp functionality (homepage forwarding, layout, 
etc) and other modules handle additional functionality such as user 
management (log in/out, registration, details modifications, etc) henc 
the need to forward actions from the default layer to the user login layer.

Is this the correct approach, or should I stick to putting it all into 
one web application?

Yves Sy wrote:
I would guess its because its not really standard practice to submit a
form to a handler from another module. It's kind of a weird flow if
you ask me. Usually you'd submit to a handler in your own module and
THEN forward to wherever else using SwitchAction.
Anyway if the SwitchAction does not work, you can go the usual
javascript way of dynamically changing the action attribute's value...
% String url = response.encodeURL(request.getContextPath() +
/another-module/myAction.do); %
document.myForm.action = '%= url%';
document.myFormsubmit();
Not very elegant but it works.
Regards,
-Yves-
On Thu, 16 Sep 2004 09:30:09 +0100, Ricardo Gladwell
[EMAIL PROTECTED] wrote:
Hi,
Thanks for that, I will try to use the switch action to forward onto the
correct module actions. Just out of interest, why doesn't the html:form
tag have a module attribute?
Yves Sy wrote:
Try using SwitchAction
-Regards-
Yves
On Wed, 15 Sep 2004 23:46:16 +0100, Ricardo Gladwell
[EMAIL PROTECTED] wrote:

Hi,
I'm experimenting with struts modules, but I've encountered a problem
whereby I have a struts html:form referencing an action in my
non-default module. Instead of referencing the correct action, I get a
Cannot retrieve mapping for action JspException.
How do I reference an action in another module from a html:form? Unlike
html:link there doesn't seem to be a module attribute?
Kind regards...
--
Ricardo Gladwell
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: html:form and modules

2004-09-16 Thread Yves Sy
What I usually do is place the login functionality (and all
common/general functionalities for that matter) in the default
struts-config at the root context.

Now if I have a more specific module or section in my app, i create a
sub-context so that all action mappings for that particular submodule
are on the same subcontext and struts-config file. An example is a
user management module where you CRUD users for your app.

Regards,
-Yves-


On Thu, 16 Sep 2004 10:36:21 +0100, Ricardo Gladwell
[EMAIL PROTECTED] wrote:
 Hi,
 
 Perhaps I'm misunderstandig the use of modules: I have a default module
 that handles basic webapp functionality (homepage forwarding, layout,
 etc) and other modules handle additional functionality such as user
 management (log in/out, registration, details modifications, etc) henc
 the need to forward actions from the default layer to the user login layer.
 
 Is this the correct approach, or should I stick to putting it all into
 one web application?
 
 
 
 Yves Sy wrote:
  I would guess its because its not really standard practice to submit a
  form to a handler from another module. It's kind of a weird flow if
  you ask me. Usually you'd submit to a handler in your own module and
  THEN forward to wherever else using SwitchAction.
 
  Anyway if the SwitchAction does not work, you can go the usual
  javascript way of dynamically changing the action attribute's value...
 
  % String url = response.encodeURL(request.getContextPath() +
  /another-module/myAction.do); %
  document.myForm.action = '%= url%';
  document.myFormsubmit();
 
  Not very elegant but it works.
 
  Regards,
  -Yves-
 
  On Thu, 16 Sep 2004 09:30:09 +0100, Ricardo Gladwell
  [EMAIL PROTECTED] wrote:
 
 Hi,
 
 Thanks for that, I will try to use the switch action to forward onto the
 correct module actions. Just out of interest, why doesn't the html:form
 tag have a module attribute?
 
 Yves Sy wrote:
 
 Try using SwitchAction
 
 -Regards-
 Yves
 
 
 On Wed, 15 Sep 2004 23:46:16 +0100, Ricardo Gladwell
 [EMAIL PROTECTED] wrote:
 
 
 Hi,
 
 I'm experimenting with struts modules, but I've encountered a problem
 whereby I have a struts html:form referencing an action in my
 non-default module. Instead of referencing the correct action, I get a
 Cannot retrieve mapping for action JspException.
 
 How do I reference an action in another module from a html:form? Unlike
 html:link there doesn't seem to be a module attribute?
 
 Kind regards...
 
 --
 Ricardo Gladwell
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 



-- 
For me to poop on!
http://www.formetopoopon.com
http://www.nbc.com/nbc/Late_Night_with_Conan_O'Brien/video/triumph.shtml

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



Re: html:form and modules

2004-09-15 Thread Yves Sy
Try using SwitchAction

-Regards-
Yves


On Wed, 15 Sep 2004 23:46:16 +0100, Ricardo Gladwell
[EMAIL PROTECTED] wrote:
 Hi,
 
 I'm experimenting with struts modules, but I've encountered a problem
 whereby I have a struts html:form referencing an action in my
 non-default module. Instead of referencing the correct action, I get a
 Cannot retrieve mapping for action JspException.
 
 How do I reference an action in another module from a html:form? Unlike
 html:link there doesn't seem to be a module attribute?
 
 Kind regards...
 
 --
 Ricardo Gladwell
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 



-- 
For me to poop on!
http://www.formetopoopon.com
http://www.nbc.com/nbc/Late_Night_with_Conan_O'Brien/video/triumph.shtml

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



Re: html:form and modules

2004-09-15 Thread Hubert Rabago
I don't think submitting a form to a separate module is allowed by the
Struts tags.

Actions are specific to each module.  IIRC, You can define the same
path in different modules and they will be treated as different
mappings.  You can even define forms with the same form name in
different modules and they will be treated as different form bean
configurations as well.

You can hack your way around it, though, by manipulating the form
tag using javascript, but then you'd have the problem of how to access
the correct form through Struts tags.

Hubert

On Wed, 15 Sep 2004 23:46:16 +0100, Ricardo Gladwell
[EMAIL PROTECTED] wrote:
 Hi,
 
 I'm experimenting with struts modules, but I've encountered a problem
 whereby I have a struts html:form referencing an action in my
 non-default module. Instead of referencing the correct action, I get a
 Cannot retrieve mapping for action JspException.
 
 How do I reference an action in another module from a html:form? Unlike
 html:link there doesn't seem to be a module attribute?
 
 Kind regards...
 
 --
 Ricardo Gladwell
 
 -
 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: html:form

2004-04-20 Thread Mathew, Manoj

just a thought?

Can we  submit two forms at a time? I thought html can handle only one form at a 
time.I think we can have any no of forms but can submit only one at a time.

Thank-you,
Manoj Mathew
GIS-Systems
(515-362-0539)


-Original Message-
From: as as [mailto:[EMAIL PROTECTED]
Sent: Monday, April 19, 2004 9:35 AM
To: Struts Users Mailing List
Subject: Re: html:form


wonderful..
i guess two submits are the culrpits here then...
then in my second form, how do i implement my fucntionality (wher i want to display a 
table- but clicking on the left most element in the table must take it to another 
pageusing javascript
please advise..
Thanks!

Christian Bollmeyer [EMAIL PROTECTED] wrote:
On Sunday 18 April 2004 16:30, as as wrote:

Hi,

Thanks for the reply. I am submitting both the forsm...

Probably, but where?

so does only one submitted form end up in the request?

Yes.

Here is my code briefly:
 
  type=com.PrincipalForm
  
 
   ID #:
 
 
 
 
 
  
   
 

This form seems to be more or less ok. Don't know
why you chose over here, but
well.

  type=com.TeachersFormname=teachers property=teacher 
 

Now check this part:

 
 
 
 property=last /


Looks pretty mangled to me; wonder if this compiles
at all. IIRC you mentioned complaints about missing
getters. This part most certainly is the culprit.

 
 
 
 
 
 

You can have multiple forms in a page, but only one
of them can be submitted at a time. Therefore, one
usually provides an with each form
declaration. You can achieve the same with JavaScript,
which you probably do here, but if you say something

document.forms[0].submit();
document.forms[1].submit();

the second line won't be executed anymore, for the
browser has already started a new request.

HTH,
-- Chris. 

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


-
Do you Yahoo!?
Yahoo! Photos: High-quality 4x6 digital prints for 25¢

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



Re: html:form

2004-04-19 Thread JavaSoft
2 forms i assumed you use 2 diffrent actions. It
wouldn't matter how many form you have as long as you
set the action in your struts-config correctly.

If you use 2 forms just imagine you have 2 diffrent
pages, how you deal with it ? so its supposed to be
same as you handle your multiform.

--- as as [EMAIL PROTECTED] wrote:
 
 Hi
 
 Has anyone implemented two html:form in a same jsp..
 
 I wish to do this to implement two tables.each table
 displaying values in a row, of a bean...
 
 so there are two beans...
 
 for some reason, it gives me error saying it cnat
 find getter for my second bean...though I did add
 getters and setters for all attributes in my struts
 form class.
 
 thanks in advance for the help,
 
 Sam
 
 
   
 -
 Do you Yahoo!?
 Yahoo! Tax Center - File online by April 15th


=
==
thx,
a Java Student




__
Do you Yahoo!?
Yahoo! Photos: High-quality 4x6 digital prints for 25¢
http://photos.yahoo.com/ph/print_splash

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



RE: html:form

2004-04-19 Thread Geeta Ramani
Jumping in here.. (so ignore this if you already have an answer..:)

If you have just the teachersDisplay form in your jsp do things work? Try that. My 
feeling is that it isn't the fcat that you have *two* forms/beans that is the problem..

Regards,
Geeta

-Original Message-
From: as as [mailto:[EMAIL PROTECTED]
Sent: Sunday, April 18, 2004 10:30 AM
To: Struts Users Mailing List
Subject: Re: html:form


Thanks for the reply. I am submitting both the forsm...so does only one submitted form 
 
 
 
end up in the request?
Here is my code briefly:

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



RE: html:form

2004-04-19 Thread as as
Yes
it works..with only teachersDisplay in the jsp
the problem comes only when i add the second form...
 
 
 
Thanks!

Geeta Ramani [EMAIL PROTECTED] wrote:
Jumping in here.. (so ignore this if you already have an answer..:)

If you have just the teachersDisplay form in your jsp do things work? Try that. My 
feeling is that it isn't the fcat that you have *two* forms/beans that is the problem..

Regards,
Geeta

-Original Message-
From: as as [mailto:[EMAIL PROTECTED]
Sent: Sunday, April 18, 2004 10:30 AM
To: Struts Users Mailing List
Subject: Re: html:form


Thanks for the reply. I am submitting both the forsm...so does only one submitted form 



end up in the request?
Here is my code briefly:

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


-
Do you Yahoo!?
Yahoo! Photos: High-quality 4x6 digital prints for 25¢

Re: html:form

2004-04-19 Thread as as
wonderful..
i guess two submits are the culrpits here then...
then in my second form, how do i implement my fucntionality (wher i want to display a 
table- but clicking on the left most element in the table must take it to another 
pageusing javascript
please advise..
Thanks!

Christian Bollmeyer [EMAIL PROTECTED] wrote:
On Sunday 18 April 2004 16:30, as as wrote:

Hi,

Thanks for the reply. I am submitting both the forsm...

Probably, but where?

so does only one submitted form end up in the request?

Yes.

Here is my code briefly:
 
  type=com.PrincipalForm
  
 
   ID #:
 
 
 
 
 
  
   
 

This form seems to be more or less ok. Don't know
why you chose over here, but
well.

  type=com.TeachersFormname=teachers property=teacher 
 

Now check this part:

 
 
 
 property=last /


Looks pretty mangled to me; wonder if this compiles
at all. IIRC you mentioned complaints about missing
getters. This part most certainly is the culprit.

 
 
 
 
 
 

You can have multiple forms in a page, but only one
of them can be submitted at a time. Therefore, one
usually provides an with each form
declaration. You can achieve the same with JavaScript,
which you probably do here, but if you say something

document.forms[0].submit();
document.forms[1].submit();

the second line won't be executed anymore, for the
browser has already started a new request.

HTH,
-- Chris. 

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


-
Do you Yahoo!?
Yahoo! Photos: High-quality 4x6 digital prints for 25¢

Re: html:form

2004-04-18 Thread as as
Thanks for the reply. I am submitting both the forsm...so does only one submitted form 
 
 
 
end up in the request?
Here is my code briefly:
 
 
 
html:form action=principalEdit name=principalForm type=com.PrincipalForm   
table border=1 width=100% 
 tr bgcolor=#EAEAE5
th align=right
  ID #:
/th
td align=left
html-el:hidden property=ID / 
bean:write name=principal property=ID /
/td
 /tr
  /table
/html:form 
html:form action=teachersDisplay name=teachersForm type=com.TeachersForm  
logic:iterate id=teacher type=Teacher name=teachers property=teacher
table
tr
td align=center
bean:write name=td align=center
bean:write name=driver property=last /
   /td property=last /
   /td
/tr
/logic:iterate
/table
/html:form 
/body
/html

Christian Bollmeyer [EMAIL PROTECTED] wrote:
On Saturday 17 April 2004 05:13, as as wrote:
 Hi

 Has anyone implemented two html:form in a same jsp..

 I wish to do this to implement two tables.each table displaying
 values in a row, of a bean...

 so there are two beans...

 for some reason, it gives me error saying it cnat find getter for my
 second bean...though I did add getters and setters for all attributes
 in my struts form class.

 thanks in advance for the help,

 Sam

Hi,

could well be I'm not fully understanding the exact problem again,
but generally, two in a single JSP page are no
problem. The one you submit ends up in the request, and
gets renderered to just a normal HTML form
tag in the end. On to the beans. I'm not sure what kind of
bean you mean here. If it's the form bean (and it's the same
table), try referring to it in your second via
the token you used for the first one. If we're talking about
two different beans here, you have to make sure both of
them are actually there and bear different token names.
In this case, you have to manually create the 'second'
instance and put it in request or whatever scope so that
it can be found.

HTH,
-- Chris.


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


-
Do you Yahoo!?
Yahoo! Photos: High-quality 4x6 digital prints for 25¢

Re: html:form

2004-04-18 Thread Christian Bollmeyer
On Sunday 18 April 2004 16:30, as as wrote:

Hi,

Thanks for the reply. I am submitting both the forsm...

Probably, but where?

so does only one submitted form end up in the request?

Yes.

Here is my code briefly:
 
 html:form action=principalEdit name=principalForm
 type=com.PrincipalForm    table border=1 width=100%
  tr bgcolor=#EAEAE5
     th align=right
       ID #:
     /th
     td align=left
     html-el:hidden property=ID /
     bean:write name=principal property=ID /
     /td
  /tr
   /table
 /html:form

This form seems to be more or less ok. Don't know
why you chose html-el over html here, but
well.

 html:form action=teachersDisplay name=teachersForm
 type=com.TeachersForm   logic:iterate id=teacher type=Teacher
 name=teachers property=teacher table
 tr

Now check this part:

 td align=center
             bean:write name=td align=center
             bean:write name=driver property=last /
    /td property=last /
    /td

Looks pretty mangled to me; wonder if this compiles
at all. IIRC you mentioned complaints about missing
getters. This part most certainly is the culprit.

 /tr
 /logic:iterate
 /table
 /html:form
 /body
 /html

You can have multiple forms in a page, but only one
of them can be submitted at a time. Therefore, one
usually provides an html:submit with each form
declaration. You can achieve the same with JavaScript,
which you probably do here, but if you say something

document.forms[0].submit();
document.forms[1].submit();

the second line won't be executed anymore, for the
browser has already started a new request.

HTH,
-- Chris. 

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



Re: html:form

2004-04-17 Thread Christian Bollmeyer
On Saturday 17 April 2004 05:13, as as wrote:
 Hi

 Has anyone implemented two html:form in a same jsp..

 I wish to do this to implement two tables.each table displaying
 values in a row, of a bean...

 so there are two beans...

 for some reason, it gives me error saying it cnat find getter for my
 second bean...though I did add getters and setters for all attributes
 in my struts form class.

 thanks in advance for the help,

 Sam

Hi,

could well be I'm not fully understanding the exact problem again,
but generally, two htlm:forms in a single JSP page are no
problem. The one you submit ends up in the request, and
html:form gets renderered to just a normal HTML form
tag in the end. On to the beans. I'm not sure what kind of
bean you mean here. If it's the form bean (and it's the same
table), try referring to it in your second html:form via
the token you used for the first one. If we're talking about
two different beans here, you have to make sure both of
them are actually there and bear different token names.
In this case, you have to manually create the 'second'
instance and put it in request or whatever scope so that
it can be found.

HTH,
-- Chris.
   

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