You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by eelboy <ee...@aol.com> on 2012/03/05 18:40:18 UTC

use struts2 in a xxxx.jsp url

Hi,

I'm very new to struts2 and have two questions that I have not seen 
asked/answered in my short time on this list (but also through plenty of 
online searching):

(1) Is it possible to invoke form validation without having the URL 
being rewritten to xxxx.action?  That is, can i keep my existing JSP 
urls but simply "add" struts2 functionality?

(2) Is it possible to manipulate the default value that is displayed for 
a specific field?  For example, if the field in question is a signed 
integer, but a value of -1 is intended to represent a default (ie, user 
did not supply a value) is there any way to not display anything in that 
field instead of "-1" - which appears to be the behavior.

Apologies if these questions have been answered before,

Thanks for any info.
edward

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


Re: Does the orrder of wildcard-annotated methods effects greediness?

Posted by Maurizio Cucchiara <mc...@apache.org>.
Not sure it works, the action definitions does not belong necessarily on
the same java class.
So it could not be so easy to choose the right priority value.

Twitter     :http://www.twitter.com/m_cucchiara
G+          :https://plus.google.com/107903711540963855921
Linkedin    :http://www.linkedin.com/in/mauriziocucchiara

Maurizio Cucchiara


On 19 March 2012 12:21, Mounir Benzid <mb...@meetingmasters.de> wrote:

> matchPriority

Re: Does the orrder of wildcard-annotated methods effects greediness?

Posted by Mounir Benzid <mb...@meetingmasters.de>.
Am 19.03.2012 09:28, schrieb Maurizio Cucchiara:
> Twitter     :http://www.twitter.com/m_cucchiara
> G+          :https://plus.google.com/107903711540963855921
> Linkedin    :http://www.linkedin.com/in/mauriziocucchiara
>
> Maurizio Cucchiara
> We could implement a "most specific take a precedence along the path"
> policy (though I don't know how ATM :) ), could you please file an issue on
> jira [1]?
> [1] https://issues.apache.org/jira/browse/WW
Definitely not the best or most elegant solution, but some sort of 
@matchPriority(A)

where A is a pos. int value (or zero) and if A > B, A fires before B

could do the trick (for now)


Usage scenario:

@Action(value="some/{stuff}", results={@Result(location ="result.jsp")})
@matchPriority(0)
public String action1() {....}

@Action(value="some/useful/{stuff}", results={@Result(location 
="result.jsp")})
@matchPriority(1)
public String action2() {....}

This way the second action method fires before the first one.


Mounir

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


Re: Does the orrder of wildcard-annotated methods effects greediness?

Posted by Maurizio Cucchiara <mc...@apache.org>.
Twitter     :http://www.twitter.com/m_cucchiara
G+          :https://plus.google.com/107903711540963855921
Linkedin    :http://www.linkedin.com/in/mauriziocucchiara

Maurizio Cucchiara
We could implement a "most specific take a precedence along the path"
policy (though I don't know how ATM :) ), could you please file an issue on
jira [1]?
[1] https://issues.apache.org/jira/browse/WW


On 19 March 2012 08:49, Mounir Benzid <mb...@meetingmasters.de> wrote:

> Am 18.03.2012 20:15, schrieb Maurizio Cucchiara:
>
>  I don't know how to get this work with annotations, but it looks like that
>> it works using xml (you can control greediness sorting by more specific
>> expression)
>>
>> Twitter     :http://www.twitter.com/m_**cucchiara<http://www.twitter.com/m_cucchiara>
>> G+          :https://plus.google.com/**107903711540963855921<https://plus.google.com/107903711540963855921>
>> Linkedin    :http://www.linkedin.com/in/**mauriziocucchiara<http://www.linkedin.com/in/mauriziocucchiara>
>>
>> Maurizio Cucchiara
>>
> It could be sufficiant if the order of the regex pattern in the  java
> class file matters or
> alternativly one should be able to make the pattern matcher itself
> nongreedy by using the ? op.
> I'm not sure though weather the ? notation will work this way.
>
>
> Mounir
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: user-unsubscribe@struts.**apache.org<us...@struts.apache.org>
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: Does the orrder of wildcard-annotated methods effects greediness?

Posted by Mounir Benzid <mb...@meetingmasters.de>.
Am 18.03.2012 20:15, schrieb Maurizio Cucchiara:
> I don't know how to get this work with annotations, but it looks like that
> it works using xml (you can control greediness sorting by more specific
> expression)
>
> Twitter     :http://www.twitter.com/m_cucchiara
> G+          :https://plus.google.com/107903711540963855921
> Linkedin    :http://www.linkedin.com/in/mauriziocucchiara
>
> Maurizio Cucchiara
It could be sufficiant if the order of the regex pattern in the  java 
class file matters or
alternativly one should be able to make the pattern matcher itself 
nongreedy by using the ? op.
I'm not sure though weather the ? notation will work this way.

Mounir

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


Re: Does the orrder of wildcard-annotated methods effects greediness?

Posted by Maurizio Cucchiara <mc...@apache.org>.
I don't know how to get this work with annotations, but it looks like that
it works using xml (you can control greediness sorting by more specific
expression)

Twitter     :http://www.twitter.com/m_cucchiara
G+          :https://plus.google.com/107903711540963855921
Linkedin    :http://www.linkedin.com/in/mauriziocucchiara

Maurizio Cucchiara


On 8 March 2012 14:53, Mounir Benzid <mb...@meetingmasters.de> wrote:

> Am 08.03.2012 14:39, schrieb Mounir Benzid:
>
>  Ok after finally getting my repositories straight I started my struts
>> junit testcase against the nighty build that is 2.3.2 SNAPSHOT
>>
>> The results are the same though.
>>
>> For the time being I'm going to change my url patterns to avoid the
>> ambiguity.
>>
>> cheers
>> - Mounir
>>
>>
>>
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail: user-unsubscribe@struts.**apache.org<us...@struts.apache.org>
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>>  Just for the record. My repositories have been installed correctly and
> running against the nightly builds for some time now.
> (I checked our local nexus repository and just found the apache snapshot
> respository was already configured there)
>
> Ok, that's all for now. Thanks again..
>
>
>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: user-unsubscribe@struts.**apache.org<us...@struts.apache.org>
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: Does the orrder of wildcard-annotated methods effects greediness?

Posted by Mounir Benzid <mb...@meetingmasters.de>.
Am 08.03.2012 14:39, schrieb Mounir Benzid:
> Ok after finally getting my repositories straight I started my struts 
> junit testcase against the nighty build that is 2.3.2 SNAPSHOT
>
> The results are the same though.
>
> For the time being I'm going to change my url patterns to avoid the 
> ambiguity.
>
> cheers
> - Mounir
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
Just for the record. My repositories have been installed correctly and 
running against the nightly builds for some time now.
(I checked our local nexus repository and just found the apache snapshot 
respository was already configured there)

Ok, that's all for now. Thanks again..



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


Re: Does the orrder of wildcard-annotated methods effects greediness?

Posted by Mounir Benzid <mb...@meetingmasters.de>.
Ok after finally getting my repositories straight I started my struts 
junit testcase against the nighty build that is 2.3.2 SNAPSHOT

The results are the same though.

For the time being I'm going to change my url patterns to avoid the 
ambiguity.

cheers
- Mounir



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


Re: Does the orrder of wildcard-annotated methods effects greediness?

Posted by Mounir Benzid <mb...@meetingmasters.de>.
Am 08.03.2012 14:15, schrieb Łukasz Lenart:
> 2012/3/8 Mounir Benzid<mb...@meetingmasters.de>:
>> To be 100% ubersure. This is how I configured mvn struts dependency
> Did you specify a repository in pom ?
>
>      <repositories>
>          <repository>
>              <id>apache-snapshot</id>
>              <name>ASF Snapshots</name>
>              <url>https://repository.apache.org/content/groups/snapshots/</url>
>              <layout>default</layout>
>              <releases>
>                  <enabled>false</enabled>
>              </releases>
>              <snapshots>
>                  <enabled>true</enabled>
>              </snapshots>
>          </repository>
>      </repositories>
>
>
> Regards
Shoot! Thanks for reminding me.

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


Re: Does the orrder of wildcard-annotated methods effects greediness?

Posted by Łukasz Lenart <lu...@googlemail.com>.
2012/3/8 Mounir Benzid <mb...@meetingmasters.de>:
> To be 100% ubersure. This is how I configured mvn struts dependency

Did you specify a repository in pom ?

    <repositories>
        <repository>
            <id>apache-snapshot</id>
            <name>ASF Snapshots</name>
            <url>https://repository.apache.org/content/groups/snapshots/</url>
            <layout>default</layout>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>


Regards
-- 
Łukasz http://www.lenart.org.pl/
mobile +48 606 323 122, office +27 11 0838747
Warszawa JUG conference - Confitura http://confitura.pl/

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


Re: Does the orrder of wildcard-annotated methods effects greediness?

Posted by Mounir Benzid <mb...@meetingmasters.de>.
Am 08.03.2012 14:01, schrieb Łukasz Lenart:
> 2012/3/8 Mounir Benzid<mb...@meetingmasters.de>:
>> Can you please tell me how to access your nightly builds through maven?
>> https://builds.apache.org/job/Struts2/lastStableBuild/org.apache.struts$struts2-assembly/
> Here
> https://repository.apache.org/content/groups/snapshots
>
>
> Regards
To be 100% ubersure. This is how I configured mvn struts dependency

<struts2-snapshot.version>2.3.2-SNAPSHOT</struts2-snapshot.version>

<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<version>${struts2-snapshot.version}</version>
</dependency>

So I'm already accessing the nightly builds. rigth?




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


Re: Does the orrder of wildcard-annotated methods effects greediness?

Posted by Łukasz Lenart <lu...@googlemail.com>.
2012/3/8 Mounir Benzid <mb...@meetingmasters.de>:
> Can you please tell me how to access your nightly builds through maven?
> https://builds.apache.org/job/Struts2/lastStableBuild/org.apache.struts$struts2-assembly/

Here
https://repository.apache.org/content/groups/snapshots


Regards
-- 
Łukasz http://www.lenart.org.pl/
mobile +48 606 323 122, office +27 11 0838747
Warszawa JUG conference - Confitura http://confitura.pl/

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


Re: Does the orrder of wildcard-annotated methods effects greediness?

Posted by Mounir Benzid <mb...@meetingmasters.de>.
Am 07.03.2012 19:17, schrieb Maurizio Cucchiara:
> In addition to what Dave suggested, could you check it against the latest
> nightly build? IIRC I made some change recently on wildcard support.

Can you please tell me how to access your nightly builds through maven?
https://builds.apache.org/job/Struts2/lastStableBuild/org.apache.struts$struts2-assembly/

or should I svn and build locally?

At the moment I'm developing against 2.3.2-snapshots

cheers
> Twitter     :http://www.twitter.com/m_cucchiara
> G+          :https://plus.google.com/107903711540963855921
> Linkedin    :http://www.linkedin.com/in/mauriziocucchiara
>
> Maurizio Cucchiara
>
>
> On 7 March 2012 18:39, Mounir Benzid<mb...@meetingmasters.de>  wrote:
>
>> Here is a simple example showing two methods in the given order
>>
>>     /***************************************************************
>> **********************************/
>>     @Override
>>     @Action(value="/do/some/**specificstuff/{thing}",
>> results={@Result(location = "result.jsp")}),
>>     public String execute() throws Exception {...}
>>
>>
>>     /***************************************************************
>> **********************************/
>>     @Override
>>     @Action(value="/do/some/{**thing}", results={@Result(location =
>> "result.jsp")}),
>>     public String input() throws Exception {...}
>>
>>
>>
>> Now if the request contains myApp/do/some/specificstuff/**eat
>>
>>
>> which action will fire? I my case it's the input() method but it really
>> should be the execute()  method.
>> The parameter "thing" in the second annotation then equals
>> "specificstuff/eat"
>>
>>
>> Is it possible to control the "greediness" of the patternmatcher? Using
>> XML notation one could simply control
>> this behaviour by  reordering the<action>  tags.
>>
>> Thanks
>>
>> - Mounir
>>
>>
>>
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail: user-unsubscribe@struts.**apache.org<us...@struts.apache.org>
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>


-- 
Mounir Benzid
Systementwickler / EDV

meetingmasters.de
meetings meisterhaft managen

· Unabhängige Vermittlung von Tagungshotels
· Online-Hotelreservierungssystem zur Integration in die Veranstaltungs-Webseite
· Webbasiertes Veranstaltungs- und Teilnehmermanagement
· E-Procurement für den Tagungshoteleinkauf
· Webbasierte Anfrage und Verhandlung von Firmenraten

Max-Planck-Straße 22
D-54296 Trier

fon +49 (0)651-145789-38
fax +49 (0)651-145789-20

www.meetingmasters.de
mb@meetingmasters.de


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


Re: Does the orrder of wildcard-annotated methods effects greediness?

Posted by Maurizio Cucchiara <mc...@apache.org>.
In addition to what Dave suggested, could you check it against the latest
nightly build? IIRC I made some change recently on wildcard support.

Twitter     :http://www.twitter.com/m_cucchiara
G+          :https://plus.google.com/107903711540963855921
Linkedin    :http://www.linkedin.com/in/mauriziocucchiara

Maurizio Cucchiara


On 7 March 2012 18:39, Mounir Benzid <mb...@meetingmasters.de> wrote:

> Here is a simple example showing two methods in the given order
>
>    /***************************************************************
> **********************************/
>    @Override
>    @Action(value="/do/some/**specificstuff/{thing}",
> results={@Result(location = "result.jsp")}),
>    public String execute() throws Exception {...}
>
>
>    /***************************************************************
> **********************************/
>    @Override
>    @Action(value="/do/some/{**thing}", results={@Result(location =
> "result.jsp")}),
>    public String input() throws Exception {...}
>
>
>
> Now if the request contains myApp/do/some/specificstuff/**eat
>
>
> which action will fire? I my case it's the input() method but it really
> should be the execute()  method.
> The parameter "thing" in the second annotation then equals
> "specificstuff/eat"
>
>
> Is it possible to control the "greediness" of the patternmatcher? Using
> XML notation one could simply control
> this behaviour by  reordering the <action> tags.
>
> Thanks
>
> - Mounir
>
>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: user-unsubscribe@struts.**apache.org<us...@struts.apache.org>
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: Does the orrder of wildcard-annotated methods effects greediness?

Posted by Mounir Benzid <mb...@meetingmasters.de>.
Am 07.03.2012 18:48, schrieb Dave Newton:
> I'm wondering if `struts.mapper.alwaysSelectFullNamespace` would affect
> this.
>
> Dave

Again the same code  (almost the same I removed the leading / in 
value="..." and added the namespace annotation to the example)

@Namespace("/do")
public class CRUDAction  {

    @Override
    @Action(value="some/specificstuff/{thing}",results={@Result(location = "result.jsp")})
    public String execute() throws Exception {...}


    @Override
    @Action(value="some/{thing}", results={@Result(location ="result.jsp")})
    public String input() throws Exception {...}

}


struts.mapper.alwaysSelectFullNamespace=true

and http://localhost/myApp/do/some/specificstuff/eat

gives me

There is no Action mapped for namespace [/do/some/specificstuff/] and
action name [eat] associated with context path [/myApp].


Struts is apparently trying to match the request /do/some/specificstuff/eat
against some namespace /do/some/specificstuff and action "eat"

which of cource doesn't exist.

Well I guess that's exaclty what

alwaysSelectFullNamespace

does.


btw: I'm using the convention plugin too if that matters.



>
> On Wed, Mar 7, 2012 at 12:39 PM, Mounir Benzid<mb...@meetingmasters.de>  wrote:
>
>> Here is a simple example showing two methods in the given order
>>
>>     /***************************************************************
>> **********************************/
>>     @Override
>>     @Action(value="/do/some/**specificstuff/{thing}",
>> results={@Result(location = "result.jsp")}),
>>     public String execute() throws Exception {...}
>>
>>
>>     /***************************************************************
>> **********************************/
>>     @Override
>>     @Action(value="/do/some/{**thing}", results={@Result(location =
>> "result.jsp")}),
>>     public String input() throws Exception {...}
>>
>>
>>
>> Now if the request contains myApp/do/some/specificstuff/**eat
>>
>>
>> which action will fire? I my case it's the input() method but it really
>> should be the execute()  method.
>> The parameter "thing" in the second annotation then equals
>> "specificstuff/eat"
>>
>>
>> Is it possible to control the "greediness" of the patternmatcher? Using
>> XML notation one could simply control
>> this behaviour by  reordering the<action>  tags.
>>
>> Thanks
>>
>> - Mounir
>>
>>
>>
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail: user-unsubscribe@struts.**apache.org<us...@struts.apache.org>
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>


-- 
Mounir Benzid
Systementwickler / EDV

meetingmasters.de
meetings meisterhaft managen

· Unabhängige Vermittlung von Tagungshotels
· Online-Hotelreservierungssystem zur Integration in die Veranstaltungs-Webseite
· Webbasiertes Veranstaltungs- und Teilnehmermanagement
· E-Procurement für den Tagungshoteleinkauf
· Webbasierte Anfrage und Verhandlung von Firmenraten

Max-Planck-Straße 22
D-54296 Trier

fon +49 (0)651-145789-38
fax +49 (0)651-145789-20

www.meetingmasters.de
mb@meetingmasters.de


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


Re: Does the orrder of wildcard-annotated methods effects greediness?

Posted by Dave Newton <da...@gmail.com>.
I'm wondering if `struts.mapper.alwaysSelectFullNamespace` would affect
this.

Dave

On Wed, Mar 7, 2012 at 12:39 PM, Mounir Benzid <mb...@meetingmasters.de> wrote:

> Here is a simple example showing two methods in the given order
>
>    /***************************************************************
> **********************************/
>    @Override
>    @Action(value="/do/some/**specificstuff/{thing}",
> results={@Result(location = "result.jsp")}),
>    public String execute() throws Exception {...}
>
>
>    /***************************************************************
> **********************************/
>    @Override
>    @Action(value="/do/some/{**thing}", results={@Result(location =
> "result.jsp")}),
>    public String input() throws Exception {...}
>
>
>
> Now if the request contains myApp/do/some/specificstuff/**eat
>
>
> which action will fire? I my case it's the input() method but it really
> should be the execute()  method.
> The parameter "thing" in the second annotation then equals
> "specificstuff/eat"
>
>
> Is it possible to control the "greediness" of the patternmatcher? Using
> XML notation one could simply control
> this behaviour by  reordering the <action> tags.
>
> Thanks
>
> - Mounir
>
>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: user-unsubscribe@struts.**apache.org<us...@struts.apache.org>
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Does the orrder of wildcard-annotated methods effects greediness?

Posted by Mounir Benzid <mb...@meetingmasters.de>.
Here is a simple example showing two methods in the given order

     
/*******************************************************************************************/
     @Override
     @Action(value="/do/some/specificstuff/{thing}", 
results={@Result(location = "result.jsp")}),
     public String execute() throws Exception {...}


     
/*******************************************************************************************/
     @Override
     @Action(value="/do/some/{thing}", results={@Result(location = 
"result.jsp")}),
     public String input() throws Exception {...}



Now if the request contains myApp/do/some/specificstuff/eat


which action will fire? I my case it's the input() method but it really 
should be the execute()  method.
The parameter "thing" in the second annotation then equals 
"specificstuff/eat"


Is it possible to control the "greediness" of the patternmatcher? Using 
XML notation one could simply control
this behaviour by  reordering the <action> tags.

Thanks

- Mounir



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


Re: use struts2 in a xxxx.jsp url

Posted by eelboy <ee...@aol.com>.
Yes, I have considered it (and still am).  I thought I would first 
inquire here about possible solutions.  If there were some way from 
within a jsp to instantiate whatever mechanism is being triggered by the 
struts.xml action element then I thought I might be able to have the 
best of both worlds.

On 03/07/2012 07:30 AM, Jeffrey Black wrote:
> Have you considered a URL Rewrite Filter?
>
> http://urlrewritefilter.googlecode.com/svn/trunk/src/doc/manual/3.2/index.html
>
> jb
>
> On Tue, Mar 6, 2012 at 6:28 PM, eelboy<ee...@aol.com>  wrote:
>
>> No -- I'm OK with that.  I'm pretty willing to do anything that is being
>> asked of me *except* handing over my uri :)  It's a requirement that, for
>> example, I can have the uri defined as /[some module]/some.jsp (again, as
>> an example).
>>
>> Using struts tags relieves me of a lot of work (mostly that I can
>> re-render the failed input page with all the user's data) but at the
>> expense it seems of now having the browser address bar as
>> "something.action" instead of /module/something.jsp.  I thought perhaps
>> there were ways around having struts re-define the uri's.
>>
>>
>> On 03/06/2012 07:51 AM, Jeffrey Black wrote:
>>
>>> Edward,
>>>
>>> Are you wanting to leverage the Struts 2 validation framework without
>>> actually having to define an "action" class?
>>>
>>> JB
>>> @jeffblack360
>>>
>>>
>>> On Mar 5, 2012, at 11:40 AM, eelboy<ee...@aol.com>   wrote:
>>>
>>>   Hi,
>>>> I'm very new to struts2 and have two questions that I have not seen
>>>> asked/answered in my short time on this list (but also through plenty of
>>>> online searching):
>>>>
>>>> (1) Is it possible to invoke form validation without having the URL
>>>> being rewritten to xxxx.action?  That is, can i keep my existing JSP urls
>>>> but simply "add" struts2 functionality?
>>>>
>>>> (2) Is it possible to manipulate the default value that is displayed for
>>>> a specific field?  For example, if the field in question is a signed
>>>> integer, but a value of -1 is intended to represent a default (ie, user did
>>>> not supply a value) is there any way to not display anything in that field
>>>> instead of "-1" - which appears to be the behavior.
>>>>
>>>> Apologies if these questions have been answered before,
>>>>
>>>> Thanks for any info.
>>>> edward
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>>
>>>>   ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>

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


Re: use struts2 in a xxxx.jsp url

Posted by Jeffrey Black <je...@gmail.com>.
Have you considered a URL Rewrite Filter?

http://urlrewritefilter.googlecode.com/svn/trunk/src/doc/manual/3.2/index.html

jb

On Tue, Mar 6, 2012 at 6:28 PM, eelboy <ee...@aol.com> wrote:

> No -- I'm OK with that.  I'm pretty willing to do anything that is being
> asked of me *except* handing over my uri :)  It's a requirement that, for
> example, I can have the uri defined as /[some module]/some.jsp (again, as
> an example).
>
> Using struts tags relieves me of a lot of work (mostly that I can
> re-render the failed input page with all the user's data) but at the
> expense it seems of now having the browser address bar as
> "something.action" instead of /module/something.jsp.  I thought perhaps
> there were ways around having struts re-define the uri's.
>
>
> On 03/06/2012 07:51 AM, Jeffrey Black wrote:
>
>> Edward,
>>
>> Are you wanting to leverage the Struts 2 validation framework without
>> actually having to define an "action" class?
>>
>> JB
>> @jeffblack360
>>
>>
>> On Mar 5, 2012, at 11:40 AM, eelboy<ee...@aol.com>  wrote:
>>
>>  Hi,
>>>
>>> I'm very new to struts2 and have two questions that I have not seen
>>> asked/answered in my short time on this list (but also through plenty of
>>> online searching):
>>>
>>> (1) Is it possible to invoke form validation without having the URL
>>> being rewritten to xxxx.action?  That is, can i keep my existing JSP urls
>>> but simply "add" struts2 functionality?
>>>
>>> (2) Is it possible to manipulate the default value that is displayed for
>>> a specific field?  For example, if the field in question is a signed
>>> integer, but a value of -1 is intended to represent a default (ie, user did
>>> not supply a value) is there any way to not display anything in that field
>>> instead of "-1" - which appears to be the behavior.
>>>
>>> Apologies if these questions have been answered before,
>>>
>>> Thanks for any info.
>>> edward
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>  ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: use struts2 in a xxxx.jsp url

Posted by eelboy <ee...@aol.com>.
No -- I'm OK with that.  I'm pretty willing to do anything that is being 
asked of me *except* handing over my uri :)  It's a requirement that, 
for example, I can have the uri defined as /[some module]/some.jsp 
(again, as an example).

Using struts tags relieves me of a lot of work (mostly that I can 
re-render the failed input page with all the user's data) but at the 
expense it seems of now having the browser address bar as 
"something.action" instead of /module/something.jsp.  I thought perhaps 
there were ways around having struts re-define the uri's.

On 03/06/2012 07:51 AM, Jeffrey Black wrote:
> Edward,
>
> Are you wanting to leverage the Struts 2 validation framework without actually having to define an "action" class?
>
> JB
> @jeffblack360
>
>
> On Mar 5, 2012, at 11:40 AM, eelboy<ee...@aol.com>  wrote:
>
>> Hi,
>>
>> I'm very new to struts2 and have two questions that I have not seen asked/answered in my short time on this list (but also through plenty of online searching):
>>
>> (1) Is it possible to invoke form validation without having the URL being rewritten to xxxx.action?  That is, can i keep my existing JSP urls but simply "add" struts2 functionality?
>>
>> (2) Is it possible to manipulate the default value that is displayed for a specific field?  For example, if the field in question is a signed integer, but a value of -1 is intended to represent a default (ie, user did not supply a value) is there any way to not display anything in that field instead of "-1" - which appears to be the behavior.
>>
>> Apologies if these questions have been answered before,
>>
>> Thanks for any info.
>> edward
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>

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


Re: use struts2 in a xxxx.jsp url

Posted by Jeffrey Black <je...@yahoo.com>.
Edward,

Are you wanting to leverage the Struts 2 validation framework without actually having to define an "action" class?

JB
@jeffblack360


On Mar 5, 2012, at 11:40 AM, eelboy <ee...@aol.com> wrote:

> Hi,
> 
> I'm very new to struts2 and have two questions that I have not seen asked/answered in my short time on this list (but also through plenty of online searching):
> 
> (1) Is it possible to invoke form validation without having the URL being rewritten to xxxx.action?  That is, can i keep my existing JSP urls but simply "add" struts2 functionality?
> 
> (2) Is it possible to manipulate the default value that is displayed for a specific field?  For example, if the field in question is a signed integer, but a value of -1 is intended to represent a default (ie, user did not supply a value) is there any way to not display anything in that field instead of "-1" - which appears to be the behavior.
> 
> Apologies if these questions have been answered before,
> 
> Thanks for any info.
> edward
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 

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