Re: It's late and I'm feeling stupid

2003-03-30 Thread Jeff Smith
Another day, and I start it out much more alert and perceptive.
Unfortunately I'm still not seeing the solution. (Undoubtedly I am ignorant
of some key piece of struts knowledge that is holding me back. :-)

I see how struts-el would allow me to reference ${foo} values within the
html-el:link tag, but that isn't the problem. The field of the html:link
tag that I want to use only takes references to beans, so I have to get my
value into a dynamically declared bean first.

I don't think struts-el tags will help with this - at least not this step in
the problem. Or am I missing something?

Any other suggestions?

Jefficus


- Original Message -
From: Dan Tran [EMAIL PROTECTED]


 It is late too and my mind also slowing down as well ;-)

 So here is my vague ans.  Use Struts-el tag lib, it works well with JSTL

 -Dan



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



Re: It's late and I'm feeling stupid

2003-03-30 Thread James Mitchell

From http://jakarta.apache.org/struts/userGuide/struts-bean.html#define

The bean:define tag differs from jsp:useBean in several ways,
including:
* Unconditionally creates (or replaces) a bean under the specified
  identifier.
* Can create a bean with the value returned by a property getter of
  a different bean (including properties referenced with a nested
  and/or indexed property name).
* Can create a bean whose contents is a literal string (or the
  result of a runtime expression) specified by the value attribute.





On Sun, 2003-03-30 at 00:47, Jeff Smith wrote:
 I have some data in an XML file.
 
 I read it in from JSP using x:set (the JSTL X tags)
 
 I then transfered it to a variable like so:
 c:set var=somevarname
 x:out ... /
 /c:set
 
 I can now dump it out happily using c:out
 
 It turns out that this particular value (an integer) is useful in a
 subsequent JSP page (if my user elects to go there by clicking the
 appropriate link). So I want to pass it as a parameter when I link to that
 next page.
 
 Aha! the html:link allows me to add parameter information. But it appears
 that such info must be in a bean.
 
 So I created a bean:
 jsp:useBean id=foo class=java.lang.String/
 
 But for all my efforts, I can't figure out how to get the somevarname
 value into foo
 
 I tried:
 jsp:useBean id=foo class=java.lang.Stringc:out
 value=${somevarname}//jsp:useBean
 but that isn't working. (Subsequent attempts to bean:write name=foo/
 come up blank.)
 
 I just know when I wake up tomorrow, the answer is going to be obvious and
 I'm going to feel stupid for asking. But one of the advantages of working
 late without much sleep is that we don't care how we're going to feel about
 it in the morning.
 
 Any suggestions?
 
 Jefficus
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
-- 
James Mitchell
Software Developer/Struts Evangelist
http://www.open-tools.org




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



Re: It's late and I'm feeling stupid

2003-03-30 Thread Dan Tran
Jeff, I tried to look at your original post and I dont really understand the
exact problem.

You post your minimal code and see if I can help.

-Dan

- Original Message -
From: Jeff Smith [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Sunday, March 30, 2003 8:42 AM
Subject: Re: It's late and I'm feeling stupid


 Another day, and I start it out much more alert and perceptive.
 Unfortunately I'm still not seeing the solution. (Undoubtedly I am
ignorant
 of some key piece of struts knowledge that is holding me back. :-)

 I see how struts-el would allow me to reference ${foo} values within the
 html-el:link tag, but that isn't the problem. The field of the html:link
 tag that I want to use only takes references to beans, so I have to get my
 value into a dynamically declared bean first.

 I don't think struts-el tags will help with this - at least not this step
in
 the problem. Or am I missing something?

 Any other suggestions?

 Jefficus


 - Original Message -
 From: Dan Tran [EMAIL PROTECTED]


  It is late too and my mind also slowing down as well ;-)
 
  So here is my vague ans.  Use Struts-el tag lib, it works well with JSTL
 
  -Dan
 


 -
 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: It's late and I'm feeling stupid

2003-03-30 Thread Jeff Smith
Thanks very much James.

Thanks also for resisting the urge to put a giant RTFM in your response. :-)

Jefficus

- Original Message -
From: James Mitchell [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Sunday, March 30, 2003 9:57 AM
Subject: Re: It's late and I'm feeling stupid



 From http://jakarta.apache.org/struts/userGuide/struts-bean.html#define

 The bean:define tag differs from jsp:useBean in several ways,
 including:
 * Unconditionally creates (or replaces) a bean under the specified
   identifier.
 * Can create a bean with the value returned by a property getter of
   a different bean (including properties referenced with a nested
   and/or indexed property name).
 * Can create a bean whose contents is a literal string (or the
   result of a runtime expression) specified by the value attribute.





 On Sun, 2003-03-30 at 00:47, Jeff Smith wrote:
  I have some data in an XML file.
 
  I read it in from JSP using x:set (the JSTL X tags)
 
  I then transfered it to a variable like so:
  c:set var=somevarname
  x:out ... /
  /c:set
 
  I can now dump it out happily using c:out
 
  It turns out that this particular value (an integer) is useful in a
  subsequent JSP page (if my user elects to go there by clicking the
  appropriate link). So I want to pass it as a parameter when I link to
that
  next page.
 
  Aha! the html:link allows me to add parameter information. But it
appears
  that such info must be in a bean.
 
  So I created a bean:
  jsp:useBean id=foo class=java.lang.String/
 
  But for all my efforts, I can't figure out how to get the somevarname
  value into foo
 
  I tried:
  jsp:useBean id=foo class=java.lang.Stringc:out
  value=${somevarname}//jsp:useBean
  but that isn't working. (Subsequent attempts to bean:write name=foo/
  come up blank.)
 
  I just know when I wake up tomorrow, the answer is going to be obvious
and
  I'm going to feel stupid for asking. But one of the advantages of
working
  late without much sleep is that we don't care how we're going to feel
about
  it in the morning.
 
  Any suggestions?
 
  Jefficus
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 --
 James Mitchell
 Software Developer/Struts Evangelist
 http://www.open-tools.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: It's late and I'm feeling stupid

2003-03-30 Thread David M. Karr
 Jeff == Jeff Smith [EMAIL PROTECTED] writes:

Jeff I have some data in an XML file.
Jeff I read it in from JSP using x:set (the JSTL X tags)

Jeff I then transfered it to a variable like so:
Jeff c:set var=somevarname
Jeff x:out ... /
Jeff /c:set

Jeff I can now dump it out happily using c:out

Jeff It turns out that this particular value (an integer) is useful in a
Jeff subsequent JSP page (if my user elects to go there by clicking the
Jeff appropriate link). So I want to pass it as a parameter when I link to that
Jeff next page.

Jeff Aha! the html:link allows me to add parameter information. But it appears
Jeff that such info must be in a bean.

Try using c:url and c:param to build up a url with parameters, then
reference the ${url} variable from the href attribute of html:link.

-- 
===
David M. Karr  ; Java/J2EE/XML/Unix/C++
[EMAIL PROTECTED]   ; SCJP; SCWCD




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



Re: It's late and I'm feeling stupid

2003-03-30 Thread Mike Deegan
Yes Jeff / David this works for me 

David Try using c:url and c:param to build up a url with
parameters, then
David reference the ${url} variable from the href attribute of
html:link.

 c:url value=userPg var=url
 c:param name=ID value=${item['id']}/
 c:param name=Dispatch value=Zoom/
 /c:url

 a href='c:out value=${url}/'[Zoom...]/a

ending up with the following displayed in the JSP
 [Zoom...]

with the following link / URL properties
http://localhost/do/userPg?ID=22Dispatch=Zoom
will open in the same window

HTH
Mike

- Original Message -
From: David M. Karr [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, March 30, 2003 10:34 AM
Subject: Re: It's late and I'm feeling stupid


  Jeff == Jeff Smith [EMAIL PROTECTED] writes:

 Jeff I have some data in an XML file.
 Jeff I read it in from JSP using x:set (the JSTL X tags)

 Jeff I then transfered it to a variable like so:
 Jeff c:set var=somevarname
 Jeff x:out ... /
 Jeff /c:set

 Jeff I can now dump it out happily using c:out

 Jeff It turns out that this particular value (an integer) is useful
in a
 Jeff subsequent JSP page (if my user elects to go there by clicking
the
 Jeff appropriate link). So I want to pass it as a parameter when I
link to that
 Jeff next page.

 Jeff Aha! the html:link allows me to add parameter information. But
it appears
 Jeff that such info must be in a bean.

 Try using c:url and c:param to build up a url with parameters,
then
 reference the ${url} variable from the href attribute of
html:link.

 ===
 David M. Karr  ; Java/J2EE/XML/Unix/C++
 [EMAIL PROTECTED]   ; SCJP; SCWCD

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



Re: It's late and I'm feeling stupid

2003-03-30 Thread Jeff Smith
That will work, but it has a built-in weakness. It side-steps the struts
action mappings by hard-coding the destination URL in the JSP.

The approach that I was using last night (which James helped me solve this
morning) was to go this way:

bean:define id=myBeanName
c:out value=${myXMLValue}/
/bean:define
html:link forward=MyActionForwardName paramId=myParamName
paramName=myBeanName/


That constructs the proper link reference:
http://localhost/MyAppName/MyActionForward.do?myParamName=myXMLValue

And it still works if I change the declaration of MyActionForwardName in
struts-config.xml

Jefficus

- Original Message -
From: Mike Deegan [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, March 30, 2003 10:39 AM
Subject: Re: It's late and I'm feeling stupid


 Yes Jeff / David this works for me 

 David Try using c:url and c:param to build up a url with
 parameters, then
 David reference the ${url} variable from the href attribute of
 html:link.

  c:url value=userPg var=url
  c:param name=ID value=${item['id']}/
  c:param name=Dispatch value=Zoom/
  /c:url

  a href='c:out value=${url}/'[Zoom...]/a

 ending up with the following displayed in the JSP
  [Zoom...]

 with the following link / URL properties
 http://localhost/do/userPg?ID=22Dispatch=Zoom
 will open in the same window

 HTH
 Mike

 - Original Message -
 From: David M. Karr [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Sunday, March 30, 2003 10:34 AM
 Subject: Re: It's late and I'm feeling stupid


   Jeff == Jeff Smith [EMAIL PROTECTED] writes:
 
  Jeff I have some data in an XML file.
  Jeff I read it in from JSP using x:set (the JSTL X tags)
 
  Jeff I then transfered it to a variable like so:
  Jeff c:set var=somevarname
  Jeff x:out ... /
  Jeff /c:set
 
  Jeff I can now dump it out happily using c:out
 
  Jeff It turns out that this particular value (an integer) is useful
 in a
  Jeff subsequent JSP page (if my user elects to go there by clicking
 the
  Jeff appropriate link). So I want to pass it as a parameter when I
 link to that
  Jeff next page.
 
  Jeff Aha! the html:link allows me to add parameter information.
But
 it appears
  Jeff that such info must be in a bean.
 
  Try using c:url and c:param to build up a url with parameters,
 then
  reference the ${url} variable from the href attribute of
 html:link.
 
  ===
  David M. Karr  ; Java/J2EE/XML/Unix/C++
  [EMAIL PROTECTED]   ; SCJP; SCWCD

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



It's late and I'm feeling stupid

2003-03-29 Thread Jeff Smith
I have some data in an XML file.

I read it in from JSP using x:set (the JSTL X tags)

I then transfered it to a variable like so:
c:set var=somevarname
x:out ... /
/c:set

I can now dump it out happily using c:out

It turns out that this particular value (an integer) is useful in a
subsequent JSP page (if my user elects to go there by clicking the
appropriate link). So I want to pass it as a parameter when I link to that
next page.

Aha! the html:link allows me to add parameter information. But it appears
that such info must be in a bean.

So I created a bean:
jsp:useBean id=foo class=java.lang.String/

But for all my efforts, I can't figure out how to get the somevarname
value into foo

I tried:
jsp:useBean id=foo class=java.lang.Stringc:out
value=${somevarname}//jsp:useBean
but that isn't working. (Subsequent attempts to bean:write name=foo/
come up blank.)

I just know when I wake up tomorrow, the answer is going to be obvious and
I'm going to feel stupid for asking. But one of the advantages of working
late without much sleep is that we don't care how we're going to feel about
it in the morning.

Any suggestions?

Jefficus


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



Re: It's late and I'm feeling stupid

2003-03-29 Thread Dan Tran
It is late too and my mind also slowing down as well ;-)

So here is my vague ans.  Use Struts-el tag lib, it works well with JSTL

-Dan

- Original Message -
From: Jeff Smith [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Saturday, March 29, 2003 9:47 PM
Subject: It's late and I'm feeling stupid


 I have some data in an XML file.

 I read it in from JSP using x:set (the JSTL X tags)

 I then transfered it to a variable like so:
 c:set var=somevarname
 x:out ... /
 /c:set

 I can now dump it out happily using c:out

 It turns out that this particular value (an integer) is useful in a
 subsequent JSP page (if my user elects to go there by clicking the
 appropriate link). So I want to pass it as a parameter when I link to that
 next page.

 Aha! the html:link allows me to add parameter information. But it
appears
 that such info must be in a bean.

 So I created a bean:
 jsp:useBean id=foo class=java.lang.String/

 But for all my efforts, I can't figure out how to get the somevarname
 value into foo

 I tried:
 jsp:useBean id=foo class=java.lang.Stringc:out
 value=${somevarname}//jsp:useBean
 but that isn't working. (Subsequent attempts to bean:write name=foo/
 come up blank.)

 I just know when I wake up tomorrow, the answer is going to be obvious and
 I'm going to feel stupid for asking. But one of the advantages of working
 late without much sleep is that we don't care how we're going to feel
about
 it in the morning.

 Any suggestions?

 Jefficus


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