Re: [S2]

2007-08-16 Thread yitzle
On 8/16/07, Steve Sether <[EMAIL PROTECTED]> wrote:
> I'm using struts 2 to create a form whose action links outside of struts
> 2. The problem is when I set the action parameter in the  the framework is putting the Struts2 context in the URL. For instance:
> say I have a struts 2 project called struts2.war, and another project
> called myProject.war.
>
> 
> ...
> 
>
> will create a 
> instead of
>  like I want.
>
> I've tried to use a literal like:  action="'/myProject/processForm'", and even the "recommended" syntax of
> %{'/myProject/processForm'}.
>
> "'/myProject/processForm'" results in action="'myProject/processForm'"
>
> while
> %{'/myProject/processForm'}
>
> results in
> action="/struts2/myProject/processForm"
>
> One way around this is of course to just use the raw  tag of html.
>   It seems like it should be possible to use the Struts 2 tag here and
> be able to gain it's benefits (though obviously not server side validations)
>

Can you specify the entire URL? Or try doing
"../myProject/processForm" or "../../myProject/processForm" or
whatever.

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



Re: [S2] How to use https on form submissions?

2007-08-16 Thread yitzle
On 8/16/07, Srinivas.N. <[EMAIL PROTECTED]> wrote:
>
> Struts 2 - Is there a way by which I can configure a form submission to use
> https?
>
> Thanks
> SN

You should be able to specify the  url to point to any URL,
including https
I am using Axis, though, and it doesn't nativaly support https. It can
be done, but I found it to be a pain

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



Re: using ${ , # and %{

2007-08-14 Thread yitzle
NOTE: This email assumes Struts 2. I'm not sure how Struts 1 works; it
may or may not be the same

On 8/14/07, Pedro Herrera <[EMAIL PROTECTED]> wrote:
>
> I´m very confused , when I must use ${ , # and %  
> What are the situations to use each one ?
>
> Thanks
>
> Herrera

I had the same problem when I started.
If you got a getVar() that struts can get the value of var from, you
can refer to it like:
 *

If you make a reference, eg

you can use the # to refer to it:


# is used for map/lists:


${} is used by JSP, not Struts, no I don't have any sample code to
share regarding it.

*I suspect in some cases you can refer to a Struts variable like:
"var" without the "%{}" but I'm not sure when/where.

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



Re: s2: Netbeans 5, 6 or Eclipse?

2007-08-14 Thread yitzle
I think NetBeans eats a lot of RAM, so if you don't have much you may
want to avoid it.
Better yet, try both out for a week or so, and see which suits *you* the best!

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



Re: MultiPartRequest bean for File Upload missing?

2007-08-12 Thread yitzle
On 8/10/07, Dave Newton <[EMAIL PROTECTED]> wrote:
> --- yitzle <[EMAIL PROTECTED]> wrote:
> > On 8/9/07, Dave Newton <[EMAIL PROTECTED]>
> > wrote:
> > > --- yitzle <[EMAIL PROTECTED]> wrote:
> > > > I had
> > > >  > > > enctype="multipart/form-data" >
> > > > and tried with
> > > >  > > > method="POST"
> > > > enctype="multipart/form-data" >
> > > > When I tried
> > > >  I got
> > > > No tag "form" defined in tag library imported
> > with
> > > > prefix "html"
> > > > even though I have
> > > > <%@ taglib prefix="html" tagdir="/WEB-INF/tags"
> > %>
> > >
> > > I can't imagine that mixing S1 tags into an S2 app
> > > would work particularly well. Perhaps
> extrapolating
> > > from the response as using the enctype in the S2
> > > form tag would be a better idea.
> > Ah... would you mind repeating that in more words?
>
> I personally cannot begin to imagine that the proposed
> solution consisting of the intermixing of custom tags
> from the Struts 1 web application framework within
> your existing Struts 2 application would lead to
> anything resembling success. Instead I would consider
> taking the audacious step of applying common sense to
> the problem and recognize that the original answer to
> your question assumed (incorrectly) the existence of a
> Struts 1 app thereby misrepresenting a potential
> solution to your original question. However, the
> general idea of the (again, incorrect) answer is also
> applicable to your current application environment,
> namely, Struts 2. The application of the spirit of the
> original answer may lead you to a potential solution
> (although I hasten to add that you did indeed find the
> solution regardless of the initially-proposed (albeit
> lacking) solution and my verbosity-lacking response
> which, apparently, instead of being taken as the
> "um... don't just read the answer, think about it"
> reminder as was intended, was instead used as a poor
> launchpad for an ill-conceived attempt at poking fun
> of what was a fairly concise interpretation of my
> feelings at the time.
>
> d.

My response was in no way an attempt to poke fun at you. Due to the
concise nature of your response, I had trouble understanding exactly
what you meant. While brevity is often a good thing, brevity to the
point of ambiguity can be counter productive. My response was simply a
request for a more verbose version of your reply, so that I would
better be able to apply your suggestion.

PS After reviewing your original post and the subsequent post, I think
I understand what you were trying to say in the first post. If you
look at the post of mine to which you replied, you will find that I
already had the enctype which you suggested I add.

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



Re: MultiPartRequest bean for File Upload missing?

2007-08-10 Thread yitzle
Solved. Found it here:
http://www.jroller.com/yokeping/entry/file_upload_with_struts_2

I had to add two libraries:
commons-fileupload-1.2.jar and commons-io-1.3.jar

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



Re: MultiPartRequest bean for File Upload missing?

2007-08-10 Thread yitzle
On 8/9/07, Dave Newton <[EMAIL PROTECTED]> wrote:
> --- yitzle <[EMAIL PROTECTED]> wrote:
> > I had
> >  > enctype="multipart/form-data" >
> > and tried with
> >  > method="POST"
> > enctype="multipart/form-data" >
> > When I tried
> >  I got
> > No tag "form" defined in tag library imported with
> > prefix "html"
> > even though I have
> > <%@ taglib prefix="html" tagdir="/WEB-INF/tags" %>
>
> I can't imagine that mixing S1 tags into an S2 app
> would work particularly well. Perhaps extrapolating
> from the response as using the enctype in the S2 form
> tag would be a better idea.
>
> d.

Ah... would you mind repeating that in more words?

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



Re: MultiPartRequest bean for File Upload missing?

2007-08-09 Thread yitzle
On 8/9/07, Hafeez-ur Rehman <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Add enctype property as form attribute
> 
>
> Hafeez
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of yitzle
> Sent: Thursday, August 09, 2007 8:23 AM
> To: Struts Users Mailing List
> Subject: MultiPartRequest bean for File Upload missing?
>
> I'm trying to add a file upload to my web app.
> When I submit the file, I get:
>
> java.lang.RuntimeException: Unable to load bean
> org.apache.struts2.dispatcher.multipart.MultiPartRequest (jakarta) -
> [unknown location]
>
> Is there a line I'm missing from my JSP or a lib/jar I need to add or
> a setting that needs changing?
> Thanks!
>

Thanks for the reply!

I had

and tried with

When I tried
 I got
No tag "form" defined in tag library imported with prefix "html"
even though I have
<%@ taglib prefix="html" tagdir="/WEB-INF/tags" %>

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



MultiPartRequest bean for File Upload missing?

2007-08-09 Thread yitzle
I'm trying to add a file upload to my web app.
When I submit the file, I get:

java.lang.RuntimeException: Unable to load bean
org.apache.struts2.dispatcher.multipart.MultiPartRequest (jakarta) -
[unknown location]

Is there a line I'm missing from my JSP or a lib/jar I need to add or
a setting that needs changing?
Thanks!

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



Re: placing 2 buttons next to each other

2007-08-02 Thread yitzle
> -Original Message-
> From: Session A Mwamufiya [mailto:[EMAIL PROTECTED]
> Sent: Thursday, August 02, 2007 1:39 PM
> To: user@struts.apache.org
> Subject: placing 2 buttons next to each other
>
> Hi,
>
> Is there a way to configure an s:form tag so that the 2 submit buttons
> appear side by side instead of one under the other?  I use a css file
> with input.actionButtons {float: left;} to move both of them to the
> left, but they're not appearing next to each other.
>
> Thanks,
> Session

I managed to do it by using the simple theme:


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



Re: Radio Buttons: name & value the same

2007-07-25 Thread yitzle

On 7/25/07, yitzle <[EMAIL PROTECTED]> wrote:

When I debugged, the getAllowUpgrade() does get called and does return
a boolean.

That should read 'isAllowUpgrade()'

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



Re: Radio Buttons: name & value the same

2007-07-25 Thread yitzle

On 7/25/07, yitzle <[EMAIL PROTECTED]> wrote:

My action has a boolean isAllowUpgrade() and a setAllowUpgrade(boolean b).

If the name is set to "blah", the correct radio button gets selected
at render time.
If the name is "allowUpgrade", neither radio button gets selected.
When I debugged, the getAllowUpgrade() does get called and does return
a boolean.



Please advise.



If I use a String instead of a boolean, I can do this:

Why won't just having a name auto-select the correct radio with booleans?

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



Radio Buttons: name & value the same

2007-07-25 Thread yitzle

My action has a boolean isAllowUpgrade() and a setAllowUpgrade(boolean b).

If the name is set to "blah", the correct radio button gets selected
at render time.
If the name is "allowUpgrade", neither radio button gets selected.
When I debugged, the getAllowUpgrade() does get called and does return
a boolean.



Please advise.

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



Re: Show message using struts

2007-07-25 Thread yitzle

On 7/25/07, tfr <[EMAIL PROTECTED]> wrote:


Hi all, I want to show some message to user. These messages will not be error
messages. These will be something like 'Data has been saved successfully'
type. Have any idea how to do it easily?


== Action Class ==
private String message;
public String getMessage() { return message; }
public void execute() {
 ...
 message = "Data has been saved successfully";
 ...
 return SUCCESS;
}

== JSP ==


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



Re: [S2] Preselected option in tag

2007-07-25 Thread yitzle

On 7/25/07, Vincent Lin <[EMAIL PROTECTED]> wrote:

I found some people are discussing this problem.
When the data type of the attribute is Integer, the value can't be too
large.
We can use toString() to make pre-selecting work.
So I changed my  tag to:



And it works now.
Is this a bug of struts 2.0.6???

On 7/25/07, Vincent Lin <[EMAIL PROTECTED]> wrote:


The 'value' property/parameter:

  value="%{adminGroupMapData.adminRid.toString()}" />

is what sets what is selected, or what gets 'jumped' to.

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



Re: Problem with radio button for one default selection

2007-07-25 Thread yitzle

On 7/25/07, Vamsi <[EMAIL PROTECTED]> wrote:

Hi all,

 I have some requirement like this I need to display a group of
radio buttons where one them is defautly checked.

 Struts 2 ui componant display all the radio buttons without any
difficulty but my problem is I am not able to make the default selection.

 is there anything to make one of the radio button deafultly
selected.

 I found strange that for a checkbox there are two componants
like checkbox and checkboxlist
why can't we have something simillar to this for radio button,so that it
will more flexible for users when some has the same kind of requirement.

  if I am missing anything in my learning please refer some
links regarding radio button only to solve the above specified problem.

  thanks for all responses
regards
Vamsi krishna


Which radio is 'checked' is set by the "value". If the value matches
one of the keys, the radio with that key will be checked.

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



Re: Radio Button - setting a to 'checked'

2007-07-23 Thread yitzle

On 7/23/07, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:

Hi,

I also experience this problem with the radio button.
Could you please give me an example of how this is done?

My code:



 gives a 'true' output.

If I change from radio to select it works ok, strange...

Thanks in advance for your help :)

ALM


I still did not manage to figure out how to set the radio buttons. I
tried hardcoding the list and value in the JSP with no success.

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



Re: New Bee Question: How do i enable validation only if certain condition is met?

2007-07-23 Thread yitzle

On 7/19/07, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:

My Question: Suppose i have a form and it has 5 text boxes. I am using
validation.xml for validating the data entered in the textboxes. My
requirement is, if the user nters data in atleast one of the textboxes
(valid or invalid) and hits submit. Only then i want to validate all the
textboxes for the valid data else i just want to go to next page.


Have the validator check that EITHER the fields are all empty OR the
data is valid

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



Re: How to control the display of Struts2 tags like s:textfield

2007-07-19 Thread yitzle

Consider wrapping it in a  tag...

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



[S2] Passing values from one action to another

2007-07-16 Thread yitzle

I got two action classes, A and B.
A has a bunch of getters and B has corresponding setters.
In order to get the value from A into B, does that value need to
appear in the JSP? e.g. ?
I know I can get it to work by passing the values through the JSP (and
calling B from the submit), but can I get the values from A's getters
to B's setters without placing them on the JSP?

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



Re: Struts 2 and Tomcat 5.0.27 filter start error

2007-07-14 Thread yitzle

Not sure how helpful this is, but I know I got the same message when I
modified my struts.xml and mistypes a class name so that it pointed to
a non-existing class.

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



Re: [s2] formatting in textfield

2007-07-13 Thread yitzle

I would image you would need some on_change JavaScript.

I found this off Google:
http://javascript.internet.com/forms/currency-format.html

You might be able to adapt it somehow.

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



[S2] JSP/OGNL - displaying iterator length

2007-07-12 Thread yitzle

I got an iterator that works fine and does what I want it to:


...


A few lines above, I try to print the iterator size:
Total: 

Doesn't display anything.

The OGNL Guide says it supports .length for arrays.
Does is not support iterators? Especially since the iterator is simple
an array container?

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



Re: Struts 2.x mapping question

2007-07-10 Thread yitzle

I found this via Google

http://struts.apache.org/2.0.8/struts2-core/apidocs/org/apache/struts2/dispatcher/mapper/DefaultActionMapper.html

Default action mapper implementation, using the standard *.[ext] (where ext usually 
"action")
pattern. The extension is looked up from the Struts configuration key 
struts.action.exection.


HTH

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



Re: [S2] Default Action

2007-07-06 Thread yitzle

I think the trouble is you want are specifying the action but not its
matching class, in which case it uses the default class which can not
be changed.

I'm suggesting that you don't have the action in the xml file and have
it use the default action for which you had specified the class.


Inside base.execute() you examine the URL and set the role.

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



Radio Button - setting a to 'checked'

2007-07-06 Thread yitzle

How to I make a radio button get rendered as checked?

I'm making several radio buttons, one per  and they all
render unchecked.
Even when I generate several with one radio tag and a map, I can't
figure out how to set one to checked.

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



Re: Struts 2 - Array of Text Fields

2007-07-06 Thread yitzle

JSP:
Create several textfields with the same name:




Action:
private String[] textFields;
public void setText (String s[]) { textFields = s; }
public String execute () throws Exception { ... }

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



Re: [S2] Default Action

2007-07-06 Thread yitzle

Oops. I misunderstood your question.
Maybe use a default action... If there is a way to 'peek' at the URL
requested, maybe you can set the role in the default execute() based
on that.

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



Re: [S2] Default Action

2007-07-05 Thread yitzle

I'm not sure what you are trying to do, but each action calls an execute()
Couldn't you set the role value in the execute()?

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



Re: Action tag with parameters

2007-07-05 Thread yitzle

Quoting http://struts.apache.org/2.x/docs/action.html

Parameters can be passed to the action using nested param tags.

(links to http://struts.apache.org/2.x/docs/param.html)

I'm not sure about the HTTP method...
What exactly are you trying to accomplish?

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



Re: Struts 2 and frames

2007-07-05 Thread yitzle

You mean you got a page that got frames and you want to eg have a
button that switches you to a single framed (er, zero frames;
frameless) page?
I know in HTML this is accomplished by setting the  attribute "target".
See http://www.w3.org/TR/html4/types.html#h-6.16

HTH

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



Re: How to change colors to an item of a select tag list

2007-07-04 Thread yitzle

Um... is there corresponding HTML/AJAX code you know of that can
accomplish that?
I don't think I've ever seen the like.

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



Re: [S2] onsubmit in tag

2007-06-26 Thread yitzle

Um... Firstly, it does the same thing.
I think if you move the code to the submit button it renders it as expected.

On 6/26/07, Dave Newton <[EMAIL PROTECTED]> wrote:

--- Vincent Lin <[EMAIL PROTECTED]> wrote:
> Why it renders onsubmit="return (validateFields());
> return true;"
> instead of onsubmit="return (validateFields())" ?
> Can I make renders  onsubmit="return
> (validateFields())" only?

Probably that's what's in the template. I'm not sure
that it really matters, though.

d.





Building a website is a piece of cake. Yahoo! Small Business gives you all the 
tools to get online.
http://smallbusiness.yahoo.com/webhosting

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




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



Re: AJAX and Struts2

2007-06-19 Thread yitzle

I may be quite wrong, but I would suggest first learning and becoming
somewhat familiar with AJAX independent of Struts before you try to
mix the two...

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



Re: [S2] Best way to catch specific exception at any point?

2007-06-19 Thread yitzle

Either of those two should solve my problem.
Thanks!

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



[S2] Best way to catch specific exception at any point?

2007-06-19 Thread yitzle

I'm working on a web app that got a weird tendency to throw a specific
exception - at any action.
What's the best way to redirect to a specific JSP on that error? With
an interceptor? Or stick in a try/catch in all my execute()'s?

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



Re: In struts 2 can we stop form submiting twice when submit button is pressd more than once

2007-06-15 Thread yitzle

I've seen websites that have an submit onclick script that disables
the submit button.
You may want to consider that approach.

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



Re: [S2] target without AJAX

2007-06-12 Thread yitzle

On 6/12/07, Dave Newton <[EMAIL PROTECTED]> wrote:

--- yitzle <[EMAIL PROTECTED]> wrote:
> I want to create a URL/A that opens in a new window.
> In HTML I would do 
> I tried making a 

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

What does the documentation for the "targets"
attribute say?

If you're just trying to create a URL that will open
in a new window I'm not sure why you're using
 at all.

d.


I put it in the subject and not in the body...
I am not using the AJAX theme. That's why targets doesn't work.
That's why I am asking how to get it to open in a new window.

Why am I using  opposed to ? I'm not quite sure... I
figured if I'm using S2 I ought to use as many S2 tags and as few HTML
tags.

I'll just use an HTML  tag, I guess.

Sorry for the bother + thanks for the feedback!

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



[S2] target without AJAX

2007-06-12 Thread yitzle

I want to create a URL/A that opens in a new window.
In HTML I would do 
I tried making a  and targets="%{'_blank'}" but
no targets appear in the HTML.
Please help.

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



Re: Struts 2 Tutorials

2007-06-09 Thread yitzle

On 6/9/07, Deepak Kumar <[EMAIL PROTECTED]> wrote:

HI,

Here is good collection of Struts 2 Tutorials
http://www.roseindia.net/struts/struts2/index.shtml


Thanks


Thank *you*!

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



Re: [S2] Using

2007-06-07 Thread yitzle

For example, it generates:

There's no such file as /console/struts/dojo/dojo.js

Sorry for the long wait. I was struggling with String (name) vs Object (value).
I had to do this:
  <%=paramValue%>
to access the JSP variable. I couldn't figure out how to use it with a value="".

On 6/7/07, Dave Newton <[EMAIL PROTECTED]> wrote:

--- yitzle <[EMAIL PROTECTED]> wrote:
> Is it true, or does  work with other themes?
>  includes a bunch of .js files
> that aren't there. Where do I get the js files from,

> and do I really need them?

What do you mean, "not there"? Not where?

d.


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



Re: [S2] Using

2007-06-07 Thread yitzle

Thanks for your reply!

I now have:






where <%=action%> is passed into the tag file with:
<%@ attribute name="action" %>

This generates the desired , except that the param values
don't show up in the URL (ie ?pName=pVal).

Also, the documentation on  mentions I need .
Is it true, or does  work with other themes?
 includes a bunch of .js files that aren't there.
Where do I get the js files from, and do I really need them?

On 6/7/07, Musachy Barroso <[EMAIL PROTECTED]> wrote:

s:url just builds a url string an pushes it into the stack, to generate an
anchor, use the s:a tag:


Goolgle

musachy

On 6/7/07, yitzle <[EMAIL PROTECTED]> wrote:
>
> The URL tag isn't working right for me. I have:
> http://www.site.com"; />
> The generated HTML is:
> http://www.site.com
> No 's. What am I doing wrong?
>
> P.S. This code is being ran via a tagfile , but I doubt
> that affects anything.


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



[S2] Using

2007-06-07 Thread yitzle

The URL tag isn't working right for me. I have:
http://www.site.com"; />
The generated HTML is:
http://www.site.com
No 's. What am I doing wrong?

P.S. This code is being ran via a tagfile , but I doubt
that affects anything.

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



Re: [S2] Mixing JSP variables and strut properties

2007-06-05 Thread yitzle

Thank you.
I got it to work (after playing with it for an hour. Stupid array
variables sometimes are singular and sometimes plural. I need to
decide on one or the other... An hour because I don't know my own
naming... )

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



[S2] Mixing JSP variables and strut properties

2007-06-05 Thread yitzle

Before I begin, I apologize if I offend anyone by asking a question
that could easily be found in the Struts 2 documentation by searching
for the correct keywords, and, no, I did not read the entire Struts
documentation nor any other Struts textbook (though I did read and
appreciate a good chunk of the Starting Struts 2 book).

See code below (numbered with cat -n).
Lines 0,1 work well. Lines 4,7,8 don't work. For line 4, I also tried
%{}, <%= %>. For line 7/8 I tried device[i].
Can someone tell me the correct way to escape/access the JSP variables
inside a Struts tag, and a Struts property (from a getter) in JSP?

Thanks!

Code:
0  PIN1: 
1  Total Count: 
2  
3  <%
4  for ( int i = 0; i < deviceCount; i++ ) {
5  %>
6  
7  
8  
9  
10  <%
11  }
12  %>
13  

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



Re: [OT] Re: [S2] Accessing URL encoded GET data (bug found?)

2007-06-04 Thread yitzle

That's why I prefer Perl ;)

On 6/4/07, Christopher Schultz <[EMAIL PROTECTED]> wrote:

That depends on your perspective:

  if("10" != 10)

doesn't even compile. Some people would say that makes Java broken. :(

- -chris


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



Re: [OT] Re: [S2] Accessing URL encoded GET data (bug found?)

2007-06-04 Thread yitzle

All working.
I've been doing well at making a perfect fool of myself...
I appreciate you taking the time to point out my obvious mistakes.

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



Re: [S2] Accessing URL encoded GET data (bug found?)

2007-06-04 Thread yitzle

As per your advice, I tried explicitly casting the map to a Map

public void setParameters (Map map)
{
Map myMap = map;
Object m = myMap.get("criteria");
message = m.toString();
}

No difference. message gets set to [Ljava.lang.String;@9a8a68
Casting myMap.get("criteria") to a String gives the same error
message, ie java.lang.ClassCastException: [Ljava.lang.String; cannot
be cast to java.lang.String

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



[S2] Accessing URL encoded GET data (bug found?)

2007-06-04 Thread yitzle

I am implementing the ParamterAware interface to get to the parameter.
The interface has a setParameters(Map parameters) that I'm supposed to
be able to use to access the GET data encoded in the URL.

From the JavaDoc API:

"Note that all parameter values for a given name will be returned, so
the type of the objects in the map is java.lang.String[]."

When I try reading data from the Map and converting to a String, I get
a casting error:
java.lang.ClassCastException: [Ljava.lang.String; cannot be cast to
java.lang.String


I did this:
public void setParameters (Map map)
{
Object m = map.get("criteria");
message = m.toString();
}
then displayed the message. I get "[Ljava.lang.String;@e35bb7"

Any clues? Bug?

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



Re: Using a tag as an attribute value

2007-06-04 Thread yitzle

Shouldn't that be jsp:attribute rather than jsp:param?...

L.

Erm... Maybe?
I got it working ->


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



Re: Empty emails [was Retrieving HTTP query string]

2007-06-04 Thread yitzle

Not sure why, but the body of the emails is in the attachment.

On 6/4/07, Musachy Barroso <[EMAIL PROTECTED]> wrote:

what are these empty emails?

musachy

On 6/4/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
> The information contained in this electronic message and any attachments
> to this message are intended for the exclusive use of the addressee(s) and
> may contain proprietary, confidential or privileged information. If you are
> not the intended recipient, you should not disseminate, distribute or copy
> this e-mail. Please notify the sender immediately and destroy all copies of
> this message and any attachments.
>
> WARNING: Computer viruses can be transmitted via email. The recipient
> should check this email and any attachments for the presence of viruses. The
> company accepts no liability for any damage caused by any virus transmitted
> by this email.
>
> www.wipro.com
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>




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



Re: Retrieving HTTP query string

2007-06-04 Thread yitzle

On 6/4/07, Dave Newton <[EMAIL PROTECTED]> wrote:

--- yitzle <[EMAIL PROTECTED]> wrote:
> How do I get the Request object?

Struts version?

S1: It's passed in to Action.execute(...)

S2: Implement ServletRequestAware
http://struts.apache.org/2.x/struts2-core/apidocs/org/apache/struts2/interceptor/ServletRequestAware.html

I have no idea why you would want to do that in S2 if
all you're doing is accessing a request parameter, and
it's a Bad Idea if that's the only reason you need it.

I guess what I wanted was the implements ParameterAware



> Implementing RequestAware gets me a map...
> There's a sun.misc.Request object, but that doesn't
> look right...

Yeah, probably not.

Do you have any familiarity with JEE at all? Have you
looked at the S2 docs which *specifically* answer this
question?

http://struts.apache.org/2.x/docs/how-can-we-access-the-httpservletrequest.html

d.


I'm not very familiar with JEE. I've used it before, but not extensively.


Thanks

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



Re: Retrieving HTTP query string

2007-06-04 Thread yitzle

On 6/4/07, Dave Newton <[EMAIL PROTECTED]> wrote:

--- yitzle <[EMAIL PROTECTED]> wrote:
> If I got a URL with a parameter embedded in it, how
> do I check what the query string is?

Struts version?

d.


Sorry. Struts 2

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



Re: Retrieving HTTP query string

2007-06-04 Thread yitzle

Its as simple as using the Request object. Request.QueryString
Maybe I am getting the question wrong. Can you explain the scenario in
which you are using this?


How do I get the Request object?
Implementing RequestAware gets me a map...
There's a sun.misc.Request object, but that doesn't look right...

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



Retrieving HTTP query string

2007-06-04 Thread yitzle

If I got a URL with a parameter embedded in it, how do I check what
the query string is?

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



Using a tag as an attribute value

2007-06-01 Thread yitzle

I got a linkIf.tag file that's working well. It checks the test and
either creates a link the the url with the body as the link content
(ie < a href="<%=url%>" >) or just shows the body
sans link.





I want to set the test attribute to be ,
and that's where I run into trouble.
I tried:

" url="manager.action">
and




and a bunch of random other bad ideas.

Can someone suggest a solution?
Other tips on the code presented would also be good to hear.
Thanks!
- Isaac

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



Re: Table Tag With Freemarker Templates

2007-05-31 Thread yitzle

Please use "user@struts.apache.org" for the "to:"

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



Re: [s2]hot deploy java and struts.xml changes in tomcat

2007-05-30 Thread yitzle

Did you look at
http://tomcat.apache.org/tomcat-6.0-doc/deployer-howto.html#Deploying%20on%20a%20running%20Tomcat%20server
?

Also view:
http://tomcat.apache.org/tomcat-6.0-doc/manager-howto.html#Reload%20An%20Existing%20Application

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



Re: struts 2 setup for tomcat 5.5/6

2007-05-30 Thread yitzle

I don't use the Tomcat manager.
I'll email you the ANT script I use

On 5/30/07, robinbajaj <[EMAIL PROTECTED]> wrote:


ooops I looked at the error message again
--
18K downloaded
[INFO] [tomcat:deploy]
[INFO] Deploying war to http://localhost:8080/tutorial64
[INFO]

[ERROR] BUILD ERROR
[INFO]

[INFO] Cannot invoke Tomcat manager

Embedded error: Connection refused: connect
--
and figured it needs a running tomcat instance.

So i did mvn tomcat:run
and it worked fine.
I can now access my tomcat instance hosting my bootstrap struts2 project at
 http://localhost:8080/tutorial65
which is cool.
thanks everyone,
robin


robinbajaj wrote:
>
> Thanks for your response Dave.
> I tried the tomcat-maven-plugin
>
> basically removed the jetty plugin and introduced tomcat-maven-plugin into
> my pom.xml
> as follows
> 
>   org.codehaus.mojo
>   tomcat-maven-plugin
>   
>   http://localhost:8080/manager66
>   
>   
>
> And then ran the mvn tomcat:deploy on command line.
> Here's the error I am getting
> URL: http://rafb.net/p/6avAol60.html67
> I don't think I have to have a tomcat pre-installed for this, since I
> noticed maven downloads
> the required components on its own. Don't know what I am doing wrong here.
> can someone please help...
> thanks,
> robin
>
>
>
>
> Dave Newton-4 wrote:
>>
>> --- yitzle <[EMAIL PROTECTED]> wrote:
>>> The way I deploy is by shutting down Tomcat, using
>>> an ANT script to copy to files into the
>>> Tomcat/webapps and starting Tomcat.
>>
>> The OP, however, wanted to use Maven.
>>
>> http://mojo.codehaus.org/tomcat-maven-plugin/69
>>
>> d.
>>
>>
>>
>>
>> 
Shape
>> Yahoo! in your own image.  Join our Network Research Panel today!
>> http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=770
>>
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>>
>
>

--
View this message in context: 
http://www.nabble.com/struts-2-setup-for-tomcat-5.5-6-tf3841534.html#a1088057573
Sent from the Struts - User mailing list archive at Nabble.com74.




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



Re: struts 2 setup for tomcat 5.5/6

2007-05-30 Thread yitzle

I'm using Struts2 + Tomcat (for a whole 2 weeks!) and its all good.
The way I deploy is by shutting down Tomcat, using an ANT script to
copy to files into the Tomcat/webapps and starting Tomcat.
I think you can deploy without closing Tomcat. You may want to check
out Tomcat's manual... There's the Tomcat admin console, also. It
might let you restart a webapp.

-

Off topic: I'd advise looking at this book next.

From: Ian Roughley <[EMAIL PROTECTED]>
Date: May 24, 2007 2:39 PM
Subject: [ANN] "Starting with Struts2" Book
To: user@struts.apache.org

I am pleased to announce the release of the mini-book "Starting with
Struts2" from InfoQ.com.

"Starting with Struts2" is aimed at those who are new to Strut2, and
those familiar with MVC frameworks but unfamiliar with Struts2.  It
provides everything you need to know to get up and running using
Struts2, and can be used as a starting point to explore the more
intricate features of the Struts2 framework.   Topics include
architecture and configuration, how to implementing actions, and
supporting infrastructure such as validation and internationalization.
Also included are productivity tips, providing a practical introduction
on how best to use the framework.

The eBook can be found at http://www.infoq.com/minibooks/starting-struts253

/Ian

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



Re: [OT] Re: [S2] Obtaining Session/Request Object

2007-05-29 Thread yitzle

On 5/29/07, Dave Newton <[EMAIL PROTECTED]> wrote:

I'm starting to feel like we're doing your
homework for you.

I'm sorry you feel that way.
If you prefer not to reply, its your prerogative.
I am just trying to understand the technology.


A "Struts project" is not a servlet. A Struts project
might *have* a servlet (and in S1 is pretty much
guaranteed to have at least one), but in S2 they might
be considered an anomaly.

"JSPs are compiled into Java Servlets by a JSP compiler. [1]"
The way I see it, so long as the result is a JSP page, the project
contains a servlet.
Granted, one can easily write the viewer component without JSP, but I
think its fair to guess that a large percentage of Struts projects
make use of JSP pages.


A web application is any application that runs on the
web, like a blog, or web email, or social site, or
whatever.

A blog, web mail or social site that was written in Java and runs on
or inside a standard server such as Tomcat would be a servlet, though.
As far as I can tell, it meets all the requirements.
It sounds like, for any program (end point; excluding containers, such
as Tomcat, Struts, etc) accessed via a browser, if it is written in
Java, it is a servlet, otherwise its a web application.
How about a solid clear definition of a servlet?

[1] http://en.wikipedia.org/wiki/JavaServer_Pages

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



Re: [S2] Obtaining Session/Request Object

2007-05-29 Thread yitzle

Alright. Read that page. Wikipedia's definition needs updating.
What I understand from that is that a servlet is basically like a Java
CGI program that runs in the web server process. So, it would seem a
Strut project is a servlet. It runs inside the web container, receives
an HTTP request, generates and sends an HTTP response. Meets all the
criteria. Right?
Now, how do you define a web application?

On 5/29/07, Al Sutton <[EMAIL PROTECTED]> wrote:

Maybe you should start with;

http://java.sun.com/products/servlet/articles/tutorial/

Instead of wikipedia or the struts documentation.

When you've got a grasp of what servlets and webapps are, then it might be
time to re-visit struts.


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



Re: [S2] Obtaining Session/Request Object

2007-05-29 Thread yitzle

Oh. OK. That makes sense...
They have some sample code here [1] that made it "click" for me.
Thanks!
[1] http://www.infoq.com/articles/converting-struts-2-part1

On 5/29/07, Dave Newton <[EMAIL PROTECTED]> wrote:

--- yitzle <[EMAIL PROTECTED]> wrote:
> SessionAware only provides a setSession() method. No
> getSession(). Do I use setSession both to set and
get
> Session variables?

No, you use the map provided to the setSession method.

d.


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



Re: [S2] Obtaining Session/Request Object

2007-05-29 Thread yitzle

SessionAware only provides a setSession() method. No getSession().
Do I use setSession both to set and get Session variables?

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



Re: [S2] Obtaining Session/Request Object

2007-05-29 Thread yitzle

The SessionAware documentation you linked me to earlier [1] states:
"This interface is only relevant if the Action is used in a servlet
environment."
So is SessionAware really ServletSessionAware and/or
ServletRequestAware the same as RequestAware?
(I'm not trying to equate two classes, but rather I'm trying to say
that either name would be correct.)

[1]http://struts.apache.org/2.x/struts2-core/apidocs/org/apache/struts2/interceptor/SessionAware.html

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



Re: [S2] Obtaining Session/Request Object

2007-05-29 Thread yitzle

On 5/29/07, Dave Newton <[EMAIL PROTECTED]> wrote:

--- yitzle <[EMAIL PROTECTED]> wrote:
> Now I need to figure out what classifies a Servlet
> vs a Web Application.

Er...

In case you're serious, a servlet is part of a web
application.

d.


Let me see if I get this...
According to Wikipedia: "A Servlet is an object that receives a
request (ServletRequest) and generates a response (ServletResponse)
based on the request. [1]"
Shouldn't that make a web server a servlet? Or must it be a Java Object?
Tomcat is a web application.
Struts2 is a framework. It basically provides a bunch of pre-built
classes and interfaces, and allows a MVC setup. The controller gets
the request. The model does some business logic and the viewer
generates a response. The viewer uses JSP, and JSPs are turned into
servlets.
Is the model a web application? A web servlet? Or just a normal Java
Object (POJO?) that I need to make SessionAware?

[1] http://en.wikipedia.org/wiki/Servlet

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



Re: [S2] Obtaining Session/Request Object

2007-05-29 Thread yitzle

Now I need to figure out what classifies a Servlet vs a Web Application.
Wikipedia should be of use...

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



Re: [S2] Obtaining Session/Request Object

2007-05-29 Thread yitzle

No, you should implement SessionAware
http://struts.apache.org/2.x/struts2-core/apidocs/org/apache/struts2/interceptor/SessionAware.html55
and avoid being tied to the Servlet spec.


... unless I am writing a Servlet.

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



[S2] Obtaining Session/Request Object

2007-05-29 Thread yitzle

I want to store session information.

From what I understand, the best way to do this is by accessing the

Session Object.
It appears I get the session by getting the Request Object
(HttpServletRequest or whatever) and calling its getSession().
Struts1 had execute() methods that took a Request as a parameter.
How do I get the Request in S2? What class can I implement that has an
execute() that gets a Request? Or is there a different way to do it?

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



Re: [S2] Field is not changed

2007-05-29 Thread yitzle

Might help to see your Action class code.
Do you have a method:
public String getTest1() and getCallTextSubject() ?

On 5/29/07, Michał Letyński <[EMAIL PROTECTED]> wrote:

Hi.
In my action class i have to different String fields(setters and getters
are aplied).
String test1;
String test2;

In my jsp page i have:

and
 typ =chain). And what are the results ? The values which
i entered are still there !



Re: [S2] How to set an action as input result ?

2007-05-29 Thread yitzle

Somewhat of a new user myself, but I think you want to read this:
http://struts.apache.org/2.x/docs/result-types.html

The default result type is Dispatcher Result. Used for JSPs.
You want a Chain Result for a .action .

The page got sample code.

Yay. I'm going to be using this myself. I guess its a good thing you
asked and I found it ;)

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



[S2] Session Beans - how to make?

2007-05-26 Thread yitzle

Hi all.
I'm a Struts Newbie here, so I apologize for the stupid question ;)

I'm working on making a fairly large Struts project.
Most data will be passed from one page/JSP to the next.
The login info has to be available on the server at every action.
How do I make a session bean or whatever that's seperate from the
other info that the action passes and is accessable for all the
actions?

PS Also, how do I have one action() forward to another? Do I just set
the result to be second.action?

Thanks!

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