Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

user Digest 25 Jul 2008 09:19:09 -0000 Issue 8160

user-digest-help

2008-07-25


Author LoginPost Reply

user Digest 25 Jul 2008 09:19:09 -0000 Issue 8160

Topics (messages 189297 through 189305):

[S2] url tag to construct href in different namespace
 189297 by: John Cartwright
 189298 by: Dave Newton

Re: [s2] Making textfield input optional
 189299 by: Jishnu Viswanath
 189300 by: Jishnu Viswanath

sorting problem with display tag: please help
 189301 by: Varun Deep
 189302 by: Al Sutton

Nothing helps
 189303 by: holod

similar problem
 189304 by: kattenok

Re: struts2 validation, tiles definition in input result type, problem!
 189305 by: Halil Aðýn

Administrivia:

---------------------------------------------------------------------
To post to the list, e-mail: user@(protected)
To unsubscribe, e-mail: user-digest-unsubscribe@(protected)
For additional commands, e-mail: user-digest-help@(protected)

----------------------------------------------------------------------

Attachment: user_189297.ezm (zipped)
Hello All,

I'm trying to use the url tag to construct a href which goes to a
different namespace. It seems that all of the constructed URLs have the
same base as the original page.

For example, given a page reached at:
http://lynx.ngdc.noaa.gov:8080/tideloader/message/View.action

The markup listed below produces this URL:
http://lynx.ngdc.noaa.gov:8080/tideloader/message/observation/View.action?localId=amkaC&operatorId=1

when what I actually want is this URL:
http://lynx.ngdc.noaa.gov:8080/tideloader/observation/View.action?localId=amkaC&operatorId=1


<a href="
   <s:url action="View" forceAddSchemeHostAndPort="true"
includeParams="none" includeContext="true" namespace="observation"
scheme="http">
     <s:param name="localId" value="key" />
     <s:param name="operatorId" value="message.operatorId" />
   </s:url>
   ">
 <s:property value="key"/>
</a>


Can someone please show me the correct way to do this?

Thanks!

--john


Attachment: user_189298.ezm (zipped)
Namespaces typically begin with a "/"; try that.

Dave

--- On Thu, 7/24/08, John Cartwright <John.C.Cartwright@(protected):

> From: John Cartwright <John.C.Cartwright@(protected)>
> Subject: [S2] url tag to construct href in different namespace
> To: "Struts Users Mailing List" <user@(protected)>
> Date: Thursday, July 24, 2008, 7:23 PM
> Hello All,
>
> I'm trying to use the url tag to construct a href which
> goes to a
> different namespace. It seems that all of the constructed
> URLs have the
> same base as the original page.
>
> For example, given a page reached at:
> http://lynx.ngdc.noaa.gov:8080/tideloader/message/View.action
>
> The markup listed below produces this URL:
> http://lynx.ngdc.noaa.gov:8080/tideloader/message/observation/View.action?localId=amkaC&operatorId=1
>
> when what I actually want is this URL:
> http://lynx.ngdc.noaa.gov:8080/tideloader/observation/View.action?localId=amkaC&operatorId=1
>
>
> <a href="
>     <s:url action="View"
> forceAddSchemeHostAndPort="true"
> includeParams="none"
> includeContext="true"
> namespace="observation"
> scheme="http">
>       <s:param name="localId"
> value="key" />
>       <s:param name="operatorId"
> value="message.operatorId" />
>     </s:url>
>     ">
>   <s:property value="key"/>
> </a>
>
>
> Can someone please show me the correct way to do this?
>
> Thanks!
>
> --john
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail:
> user-help@(protected)

Attachment: user_189299.ezm (zipped)
Hey if you are using int, float, or double instead of them use Wrapper
Classes id Integer, Float, Double former does not allow null value while
later does allow.

Regards,

Jishnu Viswanath

Software Engineer

*(+9180)41190300 - 222(Ext) ll * ( + 91 ) 9731209330ll

Tavant Technologies Inc.,

www.tavant.com

PEOPLE :: PASSION :: EXCELLENCE


-----Original Message-----
From: Milan Milanovic [mailto:milanmilanovich@(protected)]
Sent: Thursday, July 24, 2008 7:47 PM
To: user@(protected)
Subject: [s2] Making textfield input optional


Hi,

I have one form with multiple textfields, and I want to one of that
textfield be optional for user, i.e., he doesn't need to enter
information
in that particular field. Now, when user don't enter I get this in my
log:

ERROR com.opensymphony.xwork2.interceptor.ParametersInterceptor:204 -
ParametersInterceptor - [setParameters]: Unexpected Exception caught
setting
'inValue' on 'class com.myProject.action.ViewAction: Error setting
expression 'inValue' with value '[Ljava.lang.String;@(protected)'

How can I enable this but without getting this error ?

--
Thx, Milan
--
http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18
632806.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

Any comments or statements made in this email are not necessarily those of Tavant Technologies.
The information transmitted is intended only for the person or entity to which it is addressed and may
contain confidential and/or privileged material. If you have received this in error, please contact the
sender and delete the material from any computer. All e-mails sent from or to Tavant Technologies
may be subject to our monitoring procedures.


Attachment: user_189300.ezm (zipped)
Ignore my last mail on this thread. I did not see the replies.

Regards,

Jishnu Viswanath

Software Engineer

*(+9180)41190300 - 222(Ext) ll * ( + 91 ) 9731209330ll

Tavant Technologies Inc.,

www.tavant.com

PEOPLE :: PASSION :: EXCELLENCE


-----Original Message-----
From: Gabriel Belingueres [mailto:belingueres@(protected)]
Sent: Thursday, July 24, 2008 10:08 PM
To: Struts Users Mailing List
Subject: Re: [s2] Making textfield input optional

Yes, you need to write this setter in your action class.

2008/7/24 Milan Milanovic <milanmilanovich@(protected)>:
>
> Dear Gabriel,
>
> You mean in my action class ?
>
> --
> Milan
>
>
> Gabriel Belingueres-2 wrote:
>>
>> You don't need to modify your model, just delegate to it:
>>     public void setValue(String s) {
>>           if (!StringUtils.isBlank(s)) {
>>             try {
>>                model.setValue(new BigDecimal(s));
>>             catch(NumberFormatException e) {
>>                model.setValue(null);
>>             }
>>           }
>>     }
>>
>> 2008/7/24 Milan Milanovic <milanmilanovich@(protected)>:
>>>
>>> Dear Gabriel,
>>>
>>> thank you. I tried without my Converter class for BigDecimal and it
is
>>> the
>>> same, when user doesn't enter value I got that error in a log.
>>>
>>> I'm using S2 2.0.11.1. This solution is good, but my value that is
set
>>> comes
>>> from model where I have class and attribute (BigDecimal) with its
get/set
>>> methods, by putting this set(String) instead of set(BigDecimal) I'm
>>> violating class semantics ?
>>>
>>> The other solution is O.K., but I've already used it with Dates and
>>> datetimepicker. Can I change in some way this BigDecimal converter
to
>>> avoid
>>> this error:
>>>
http://www.nabble.com/-s2--Formatting-input-textfields-tt18593985.html
>>>
http://www.nabble.com/-s2--Formatting-input-textfields-tt18593985.html
>>>
>>> --
>>> Regards, Milan.
>>>
>>>
>>>
>>>
>>> Gabriel Belingueres-2 wrote:
>>>>
>>>> I'm using S2.1.2 (are you using the same version?), and it will
throw
>>>> a NumberFormatException when setting an empty string, but this
>>>> workaround will make ParameterInterceptor to think it is setting a
>>>> String parameter:
>>>>
>>>>     public void setValue(String s) {
>>>>          if (!StringUtils.isBlank(s)) {
>>>>              try {
>>>>               this.value= new BigDecimal(s);
>>>>              catch(NumberFormatException e) {
>>>>                 this.value = null;
>>>>              }
>>>>          }
>>>>     }
>>>>
>>>> of course you still need a validator so that the string doesn't
>>>> violate the BigDecimal grammar.
>>>>
>>>> Other option (may be more clean) is the action having both the
string
>>>> instance and the real BigDecimal instance, then the form will only
set
>>>> the string instance.
>>>>
>>>> 2008/7/24 Milan Milanovic <milanmilanovich@(protected)>:
>>>>>
>>>>> Dear Newton,
>>>>>
>>>>> Yes, I'm using BigDecimal type converter given here:
>>>>>
http://www.nabble.com/-s2--Formatting-input-textfields-tt18593985.html
>>>>>
http://www.nabble.com/-s2--Formatting-input-textfields-tt18593985.html
>>>>> .
>>>>>
>>>>> --
>>>>> Thx, Milan
>>>>>
>>>>>
>>>>> newton.dave wrote:
>>>>>>
>>>>>> Are you using a BigDecimal type converter (one of which was just
>>>>>> posted)?
>>>>>>
>>>>>> AFAIK it won't work w/o the converter, but I could be remembering
>>>>>> incorrectly.
>>>>>>
>>>>>> Dave
>>>>>>
>>>>>> --- On Thu, 7/24/08, Milan Milanovic <milanmilanovich@(protected)>
>>>>>> wrote:
>>>>>>
>>>>>>> From: Milan Milanovic <milanmilanovich@(protected)>
>>>>>>> Subject: Re: [s2] Making textfield input optional
>>>>>>> To: user@(protected)
>>>>>>> Date: Thursday, July 24, 2008, 11:36 AM
>>>>>>> Dear Gabriel,
>>>>>>>
>>>>>>> no, my actual question is related to the issue when user
>>>>>>> doesn't enter
>>>>>>> anything to the textfield which is connected to BigDecimal
>>>>>>> in my action
>>>>>>> class.
>>>>>>>
>>>>>>> --
>>>>>>> Thx, Milan
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Gabriel Belingueres-2 wrote:
>>>>>>> >
>>>>>>> > Please make sure that the input string is according
>>>>>>> the BigDecimal format:
>>>>>>> >
>>>>>>>
http://java.sun.com/j2se/1.5.0/docs/api/java/math/BigDecimal.html#BigDec
imal(java.lang.String)
>>>>>>> >
>>>>>>> > 2008/7/24 Milan Milanovic
>>>>>>> <milanmilanovich@(protected)>:
>>>>>>> >>
>>>>>>> >> Hi Gabriel,
>>>>>>> >>
>>>>>>> >> no I cannot do this because my field is of type
>>>>>>> BigDecimal and I must
>>>>>>> >> have
>>>>>>> >> get/set methods for it.
>>>>>>> >>
>>>>>>> >> --
>>>>>>> >> Thx, Milan
>>>>>>> >>
>>>>>>> >>
>>>>>>> >> Gabriel Belingueres-2 wrote:
>>>>>>> >>>
>>>>>>> >>> instead of:
>>>>>>> >>>
>>>>>>> >>> public vlid setInValue(BigDecimal x) {
>>>>>>> >>>  this.x = x;
>>>>>>> >>> }
>>>>>>> >>>
>>>>>>> >>> test with this:
>>>>>>> >>>
>>>>>>> >>> public vlid setInValue(String s) {
>>>>>>> >>>  this.x = new BigDecimal(s);
>>>>>>> >>> }
>>>>>>> >>>
>>>>>>> >>>
>>>>>>> >>> 2008/7/24 Milan Milanovic
>>>>>>> <milanmilanovich@(protected)>:
>>>>>>> >>>>
>>>>>>> >>>> Hi Jim,
>>>>>>> >>>>
>>>>>>> >>>> no, I have that method.
>>>>>>> >>>>
>>>>>>> >>>> --
>>>>>>> >>>> Thx, Milan
>>>>>>> >>>>
>>>>>>> >>>>
>>>>>>> >>>> Jim Kiley wrote:
>>>>>>> >>>>>
>>>>>>> >>>>> Doesn't that exception usually get
>>>>>>> thrown when, in this case,
>>>>>>> >>>>> ViewAction
>>>>>>> >>>>> doesn't have a setInValue()
>>>>>>> method?
>>>>>>> >>>>>
>>>>>>> >>>>> jk
>>>>>>> >>>>>
>>>>>>> >>>>> On Thu, Jul 24, 2008 at 10:31 AM,
>>>>>>> Gabriel Belingueres
>>>>>>> >>>>> <belingueres@(protected)>
>>>>>>> >>>>> wrote:
>>>>>>> >>>>>
>>>>>>> >>>>>> Which is the data type of inValue?
>>>>>>> >>>>>>
>>>>>>> >>>>>> 2008/7/24 Milan Milanovic
>>>>>>> <milanmilanovich@(protected)>:
>>>>>>> >>>>>> >
>>>>>>> >>>>>> > Hi,
>>>>>>> >>>>>> >
>>>>>>> >>>>>> > I have one form with multiple
>>>>>>> textfields, and I want to one of that
>>>>>>> >>>>>> > textfield be optional for
>>>>>>> user, i.e., he doesn't need to enter
>>>>>>> >>>>>> information
>>>>>>> >>>>>> > in that particular field.
>>>>>>> Now, when user don't enter I get this in
>>>>>>> >>>>>> my
>>>>>>> >>>>>> log:
>>>>>>> >>>>>> >
>>>>>>> >>>>>> > ERROR
>>>>>>> com.opensymphony.xwork2.interceptor.ParametersInterceptor:204
>>>>>>> >>>>>> -
>>>>>>> >>>>>> > ParametersInterceptor -
>>>>>>> [setParameters]: Unexpected Exception
>>>>>>> >>>>>> caught
>>>>>>> >>>>>> setting
>>>>>>> >>>>>> > 'inValue' on
>>>>>>> 'class com.myProject.action.ViewAction: Error setting
>>>>>>> >>>>>> > expression 'inValue'
>>>>>>> with value '[Ljava.lang.String;@(protected)'
>>>>>>> >>>>>> >
>>>>>>> >>>>>> > How can I enable this but
>>>>>>> without getting this error ?
>>>>>>> >>>>>> >
>>>>>>> >>>>>> > --
>>>>>>> >>>>>> > Thx, Milan
>>>>>>> >>>>>> > --
>>>>>>> >>>>>> > View this message in context:
>>>>>>> >>>>>>
>>>>>>>
http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18
632806.html
>>>>>>> >>>>>> > Sent from the Struts - User
>>>>>>> mailing list archive at Nabble.com.
>>>>>>> >>>>>> >
>>>>>>> >>>>>> >
>>>>>>> >>>>>> >
>>>>>>> >>>>>>
>>>>>>>
---------------------------------------------------------------------
>>>>>>> >>>>>> > To unsubscribe, e-mail:
>>>>>>> user-unsubscribe@(protected)
>>>>>>> >>>>>> > For additional commands,
>>>>>>> e-mail: user-help@(protected)
>>>>>>> >>>>>> >
>>>>>>> >>>>>> >
>>>>>>> >>>>>>
>>>>>>> >>>>>>
>>>>>>>
---------------------------------------------------------------------
>>>>>>> >>>>>> To unsubscribe, e-mail:
>>>>>>> user-unsubscribe@(protected)
>>>>>>> >>>>>> For additional commands, e-mail:
>>>>>>> user-help@(protected)
>>>>>>> >>>>>>
>>>>>>> >>>>>>
>>>>>>> >>>>>
>>>>>>> >>>>>
>>>>>>> >>>>> --
>>>>>>> >>>>> Jim Kiley
>>>>>>> >>>>> Technical Consultant | Summa
>>>>>>> >>>>> [p] 412.258.3346 [m] 412.445.1729
>>>>>>> >>>>> http://www.summa-tech.com
>>>>>>> >>>>>
>>>>>>> >>>>>
>>>>>>> >>>>
>>>>>>> >>>> --
>>>>>>> >>>> View this message in context:
>>>>>>> >>>>
>>>>>>>
http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18
633474.html
>>>>>>> >>>> Sent from the Struts - User mailing list
>>>>>>> archive at Nabble.com.
>>>>>>> >>>>
>>>>>>> >>>>
>>>>>>> >>>>
>>>>>>>
---------------------------------------------------------------------
>>>>>>> >>>> To unsubscribe, e-mail:
>>>>>>> user-unsubscribe@(protected)
>>>>>>> >>>> For additional commands, e-mail:
>>>>>>> user-help@(protected)
>>>>>>> >>>>
>>>>>>> >>>>
>>>>>>> >>>
>>>>>>> >>>
>>>>>>>
---------------------------------------------------------------------
>>>>>>> >>> To unsubscribe, e-mail:
>>>>>>> user-unsubscribe@(protected)
>>>>>>> >>> For additional commands, e-mail:
>>>>>>> user-help@(protected)
>>>>>>> >>>
>>>>>>> >>>
>>>>>>> >>>
>>>>>>> >>
>>>>>>> >> --
>>>>>>> >> View this message in context:
>>>>>>> >>
>>>>>>>
http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18
633888.html
>>>>>>> >> Sent from the Struts - User mailing list archive
>>>>>>> at Nabble.com.
>>>>>>> >>
>>>>>>> >>
>>>>>>> >>
>>>>>>>
---------------------------------------------------------------------
>>>>>>> >> To unsubscribe, e-mail:
>>>>>>> user-unsubscribe@(protected)
>>>>>>> >> For additional commands, e-mail:
>>>>>>> user-help@(protected)
>>>>>>> >>
>>>>>>> >>
>>>>>>> >
>>>>>>> >
>>>>>>>
---------------------------------------------------------------------
>>>>>>> > To unsubscribe, e-mail:
>>>>>>> user-unsubscribe@(protected)
>>>>>>> > For additional commands, e-mail:
>>>>>>> user-help@(protected)
>>>>>>> >
>>>>>>> >
>>>>>>> >
>>>>>>>
>>>>>>> --
>>>>>>> View this message in context:
>>>>>>>
http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18
634541.html
>>>>>>> Sent from the Struts - User mailing list archive at
>>>>>>> Nabble.com.
>>>>>>>
>>>>>>>
>>>>>>>
---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>>>>>>> For additional commands, e-mail:
>>>>>>> user-help@(protected)
>>>>>>
>>>>>>
---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>>>>>> For additional commands, e-mail: user-help@(protected)
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>> --
>>>>> View this message in context:
>>>>>
http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18
634840.html
>>>>> Sent from the Struts - User mailing list archive at Nabble.com.
>>>>>
>>>>>
>>>>>
---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>>>>> For additional commands, e-mail: user-help@(protected)
>>>>>
>>>>>
>>>>
>>>>
---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>>>> For additional commands, e-mail: user-help@(protected)
>>>>
>>>>
>>>>
>>>
>>> --
>>> View this message in context:
>>>
http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18
635312.html
>>> Sent from the Struts - User mailing list archive at Nabble.com.
>>>
>>>
>>>
---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>>> For additional commands, e-mail: user-help@(protected)
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>>
>
> --
> View this message in context:
http://www.nabble.com/-s2--Making-textfield-input-optional-tp18632806p18
635560.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

Any comments or statements made in this email are not necessarily those of Tavant Technologies.
The information transmitted is intended only for the person or entity to which it is addressed and may
contain confidential and/or privileged material. If you have received this in error, please contact the
sender and delete the material from any computer. All e-mails sent from or to Tavant Technologies
may be subject to our monitoring procedures.


Attachment: user_189301.ezm (zipped)
Hi

I am using the display tag for displaying the employee names . I want to
short the names of the employee.

Following is the code that is in .jsp file.

<%@(protected)"%>

<display:table id="displaycolumn" name="listOfEmployee"
   pagesize="6" requestURI="searchEmployeeByDep.action"
   decorator="com.unclejis.action.restaurant.DisplayDecorator"
    align="left" sort="external" defaultsort="1" >

   <display:column property="name" title="Name" sortable="true" />
</display:table>



when I use the above code nothing is display. Can anyone please help me
to solve this problem. I will be vary thankful.

Thanks in advance
varun



Attachment: user_189302.ezm (zipped)
What did the display tag people say when you posted on their lists at
http://displaytag.sourceforge.net/11/mail-lists.html ?

Varun Deep wrote:
> Hi
>
> I am using the display tag for displaying the employee names . I want to
> short the names of the employee.
>
> Following is the code that is in .jsp file.
>
> <%@(protected)"%>
>
> <display:table id="displaycolumn" name="listOfEmployee"
>     pagesize="6" requestURI="searchEmployeeByDep.action"
>     decorator="com.unclejis.action.restaurant.DisplayDecorator"
>      align="left" sort="external" defaultsort="1" >
>
>     <display:column property="name" title="Name" sortable="true" />
> </display:table>
>
>
>
> when I use the above code nothing is display. Can anyone please help me
> to solve this problem. I will be vary thankful.
>
> Thanks in advance
> varun
>
>
>
>  


Attachment: user_189303.ezm (zipped)

attribute "var" doesn't exist in my struts-tags.tld. I'm using the last one
struts2 pack.

lawDraft.docs returns List with 5 elements.
Simple printing </s:property value="lawDraft.docs"> shows 5 elements

I've tried to invoke method "getTitle()" of class Document which instances
are in ArrayList:
1.
<s:iterator value="lawDraft.docs" status="document" id="doc">
</s:property value ="title">
</s:iterator>
Nothing, empty string

2.
<s:iterator value="lawDraft.docs" status="document" id="doc">
</s:property value ="%{#doc.title}">
</s:iterator>
Nothing, empty string

Previous actions prints to log fields of objects kept in Lawdraft.getDocs()
I know, that title is not null or empty.

Can you suggest me something else?
--
Sent from the Struts - User mailing list archive at Nabble.com.


Attachment: user_189304.ezm (zipped)

I have similar problem. On one page of my site I configurate some settings
(forexample attribute "country" set true). That changes set to data base (I
cheked it). Then I go to other page , where (if attribute "country" is true)
textbox "country" is visible, but it isn't. The problem that nhibernate
returns old value ("country" is false). And there is one more strange thing
- nhibernate cat return right value for fist load of page and old value for
second (if i press F5 ), or old value for fist load and right value for
second or for third.
In other words if i press F5 I can't be sure what value I get(right or old).
Please help me.
--
Sent from the Struts - User mailing list archive at Nabble.com.


Attachment: user_189305.ezm (zipped)
Hello Dave;

Yes you are right, There is no "ProjectStatus" action defined.
Now, i change the form action definition to

<s:form action="ProjectStatus_showAddPage"
..

and it is ok. validation works, but there is still a problem,

When i request the
http://localhost:8080/TVQ/ProjectStatus_showAddPage.action (showAddPage
function is defined in ProjectStatus action class)

it shows the AddPage.jsp (which is expected), but it shows all the
validation messages at first page load which is not expected.

The correct scenario is that it should show the validation messages after i
press the add button.


Here is my jsp content and struts.xml content, respectively (I do not
include tiles definition, they works, morover, they are not needed to
analyze this problem, i think :) )

There is also a validation file named ProjectStatus-validation,xml in the
directory where ProjectStatusAction.java resides in.

===========start:AddPage.jsp=============
<s:form action="ProjectStatus_showAddPage" validate="true"    >

<s:fielderror />

<jsp:include page="AddUpdateTemplate.jsp"/>
<br/>

<table>
<tr><td colspan="2"><s:submit  method="add" value="Add" /></td></tr>
</table>

</s:form>

===========end :AddPage    =============



===========start:struts.xml=============
  <action name="ProjectStatus_*"

class="tr.com.portakalteknoloji.action.projectstatus.ProjectStatusAction"
       method="{1}" >

       <result name="{1}" type="tiles" >tvq.projectstatus.{1}</result>
       <result name="input" type="tiles"
>tvq.projectstatus.{1}</result>
       <result name="ADDSUCCEED"
type="redirect">/ProjectStatus_list.action</result>

    </action>
===========end :struts.xml =============






Regards,


-Halil AGIN


On Thu, Jul 24, 2008 at 6:22 PM, Dave Newton <newton.dave@(protected):

> Your action is submitting to "ProjectStatus"; is that action defined?
>
> Dave
>
>
> --- On Thu, 7/24/08, Halil Ağın <halil.agin@(protected):
>
> > From: Halil Ağın <halil.agin@(protected)>
> > Subject: struts2 validation, tiles definition in input result type,
> problem!
> > To: user@(protected)
> > Date: Thursday, July 24, 2008, 10:58 AM
> > Hello List;
> >
> > I am trying to implement validation in struts2.
> >
> > My action is as follow:
> >
> > <action name="ProjectStatus_*"
> >
> > class="tr.com.portakalteknoloji.action.projectstatus.ProjectStatusAction"
> >         method="{1}" >
> >
> >         <result name="{1}"
> > type="tiles"
> > >tvq.projectstatus.{1}</result>
> >         <result name="input"
> > type="tiles"
> > >tvq.projectstatus.{1}</result>
> >         <result name="error"
> > type="tiles">tvq.projectstatus.{1}</result>
> >
> >         <result name="ADDSUCCEED"
> > type="redirect">/ProjectStatus_list.action</result>
> >      </action>
> >
> >
> >
> > Since when validation process returns false, i want struts
> > to show the same
> > page. I search the web, and saw some solution like above.
> > But, when i try to
> > implement, i could not succeed.
> >
> > Here are my tiles definitions:
> >
> > <definition
> > name="tvq.projectstatus.showAddPage"
> > extends="tvq.template.default">
> >      <put-attribute name="title"
> > value="Add A Project Status" />
> >      <put-attribute name="content"
> > value="/jsp/projectstatus/AddPage.jsp"
> > />
> >   </definition>
> >
> >   <definition
> > name="tvq.projectstatus.ListPage"
> > extends="tvq.template.default">
> >      <put-attribute name="title"
> > value="Add A Project Status" />
> >      <put-attribute name="content"
> > value="/jsp/projectstatus/ListPage.jsp" />
> >   </definition>
> >
> >   <definition name="tvq.projectstatus.list"
> > extends="tvq.template.default">
> >      <put-attribute name="title"
> > value="Add A Project Status" />
> >      <put-attribute name="content"
> > value="/jsp/projectstatus/ListPage.jsp" />
> >   </definition>
> >
> >
> >
> > I call the page ass follows :
> > http://localhost:8080/TVQ/ProjectStatus_showAddPage.action
> >
> > (the ProjectStatusAction.java has showAddPage, list, and
> > add functions and
> > these functions returns the correct strings.)
> >
> >
> > Then, struts looks the action definition and it finds
> > showAddPage function
> > in ProjectStatus.
> >
> > In result list, there is tvq.projectstatus.showAddPage, and
> > i have this
> > definition in my tiles.xml.
> >
> > Therefore, it shows the page. The problem occures after i
> > press the add
> > button in tvq.projectstatus.showAddPage.
> >
> > here is the content of the
> > tvq.projectstatus.showAddPage(meanly,/jsp/projectstatus/AddPage.jsp)
> >
> >
> >
> >
> > <s:form action="ProjectStatus"
> > validate="true"    >
> >
> > <s:fielderror />
> >
> > <jsp:include page="AddUpdateTemplate.jsp"/>
> > <br/>
> >
> > <table>
> > <tr><td colspan="2"><s:submit
> > method="add" value="Add"
> > /></td></tr>
> > </table>
> >
> > </s:form>
> >
> >
> >
> >
> > And i have a required field validator on a field in my
> > form(this field is
> > listed in AddUpdateTemplate.jsp)
> >
> >
> > ProjectStatus action has add function which returns the
> > "ADDSUCCEED" string
> > on success.
> >
> >
> > When i press the add button without filling the required
> > field, there occure
> > a validation error(which is expected)
> >
> > At this level, i expect struts that it enters the input
> > result which is
> > defined in my action as a result.
> >
> > Here is the result definition.
> >
> > <result name="input" type="tiles"
> > >tvq.projectstatus.{1}</result>
> >
> >
> > I expect the struts to enter in input result, and it does.
> > but it cannot
> > produces the tiles definition, it leaves {1} as empty and
> > produce
> > "tvq.projectstatus." unlike
> > "tvq.projectstatus.showAddPage".
> >
> > What is the problem, i know i am doing something wrong, i
> > read the book
> > "struts2 in action", and searched the web, but
> > could not find such an
> > example. Meanly, i am using method action, tiles and
> > validation together, i
> > could not find such an example.
> >
> >
> > Please help me,
> >
> >
> > Thanks in advance,
> >
> >
> > -Halil Agin
> >
> >
> > the stack trace is below (i am using global exception
> > handler, therefore i
> > copied the html content and paste it here, you may want the
> > output of error
> > console, but please be sure that this is the exact error. i
> > see this error
> > in the console too)
> >
> >
> > Error Message
> >
> > tvq.projectstatus.
> > ------------------------------
> > Technical Details
> >
> > org.apache.tiles.definition.NoSuchDefinitionException:
> > tvq.projectstatus. at
> >
> org.apache.tiles.impl.BasicTilesContainer.render (BasicTilesContainer.java:394)
> > at
> >
> org.apache.tiles.impl.BasicTilesContainer.render (BasicTilesContainer.java:370)
> > at
> >
> org.apache.struts2.views.tiles.TilesResult.doExecute(TilesResult.java:105)
> > at
> >
> org.apache.struts2.dispatcher.StrutsResultSupport.execute (StrutsResultSupport.java:186)
> > at
> >
> com.opensymphony.xwork2.DefaultActionInvocation.executeResult (DefaultActionInvocation.java:355)
> > at
> >
> com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:259)
> > at
> >
> com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept (ValidationInterceptor.java:248)
> > at
> >
> org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept (AnnotationValidationInterceptor.java:49)
> > at
> >
> com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept (MethodFilterInterceptor.java:86)
> > at
> >
> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230)
> > at
> >
> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229)
> > at
> >
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile (UtilTimerStack.java:456)
> > at
> >
> com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:227)
> > at
> >
> com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept (ConversionErrorInterceptor.java:124)
> > at
> >
> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230)
> > at
> >
> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229)
> > at
> >
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile (UtilTimerStack.java:456)
> > at
> >
> com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:227)
> > at
> >
> com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept (ParametersInterceptor.java:170)
> > at
> >
> com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept (MethodFilterInterceptor.java:86)
> > at
> >
> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230)
> > at
> >
> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229)
> > at
> >
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile (UtilTimerStack.java:456)
> > at
> >
> com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:227)
> > at
> >
> com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept (ParametersInterceptor.java:170)
> > at
> >
> com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept (MethodFilterInterceptor.java:86)
> > at
> >
> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230)
> > at
> >
> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229)
> > at
> >
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile (UtilTimerStack.java:456)
> > at
> >
> com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:227)
> > at
> >
> com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept (StaticParametersInterceptor.java:104)
> > at
> >
> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230)
> > at
> >
> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229)
> > at
> >
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile (UtilTimerStack.java:456)
> > at
> >
> com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:227)
> > at
> >
> org.apache.struts2.interceptor.CheckboxInterceptor.intercept (CheckboxInterceptor.java:84)
> > at
> >
> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230)
> > at
> >
> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229)
> > at
> >
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile (UtilTimerStack.java:456)
> > at
> >
> com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:227)
> > at
> >
> org.apache.struts2.interceptor.FileUploadInterceptor.intercept (FileUploadInterceptor.java:208)
> > at
> >
> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230)
> > at
> >
> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229)
> > at
> >
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile (UtilTimerStack.java:456)
> > at
> >
> com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:227)
> > at
> >
> com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept (ModelDrivenInterceptor.java:88)
> > at
> >
> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230)
> > at
> >
> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229)
> > at
> >
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile (UtilTimerStack.java:456)
> > at
> >
> com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:227)
> > at
> >
> com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept (ScopedModelDrivenInterceptor.java:127)
> > at
> >
> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230)
> > at
> >
> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229)
> > at
> >
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile (UtilTimerStack.java:456)
> > at
> >
> com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:227)
> > at
> >
> org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept (ProfilingActivationInterceptor.java:104)
> > at
> >
> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230)
> > at
> >
> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229)
> > at
> >
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile (UtilTimerStack.java:456)
> > at
> >
> com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:227)
> > at
> >
> org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept (DebuggingInterceptor.java:267)
> > at
> >
> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230)
> > at
> >
> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229)
> > at
> >
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile (UtilTimerStack.java:456)
> > at
> >
> com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:227)
> > at
> >
> com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept (ChainingInterceptor.java:130)
> > at
> >
> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230)
> > at
> >
> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229)
> > at
> >
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile (UtilTimerStack.java:456)
> > at
> >
> com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:227)
> > at
> >
> com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept (I18nInterceptor.java:143)
> > at
> >
> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230)
> > at
> >
> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229)
> > at
> >
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile (UtilTimerStack.java:456)
> > at
> >
> com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:227)
> > at
> >
> com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept (PrepareInterceptor.java:137)
> > at
> >
> com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept (MethodFilterInterceptor.java:86)
> > at
> >
> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230)
> > at
> >
> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229)
> > at
> >
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile (UtilTimerStack.java:456)
> > at
> >
> com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:227)
> > at
> >
> org.apache.struts2.interceptor.ServletConfigInterceptor.intercept (ServletConfigInterceptor.java:164)
> > at
> >
> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230)
> > at
> >
> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229)
> > at
> >
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile (UtilTimerStack.java:456)
> > at
> >
> com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:227)
> > at
> >
> com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept (AliasInterceptor.java:130)
> > at
> >
> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230)
> > at
> >
> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229)
> > at
> >
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile (UtilTimerStack.java:456)
> > at
> >
> com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:227)
> > at
> >
> com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept (ExceptionMappingInterceptor.java:176)
> > at
> >
> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230)
> > at
> >
> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229)
> > at
> >
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile (UtilTimerStack.java:456)
> > at
> >
> com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:227)
> > at
> >
> org.apache.struts2.impl.StrutsActionProxy.execute (StrutsActionProxy.java:52)
> > at
> >
> org.apache.struts2.dispatcher.Dispatcher.serviceAction (Dispatcher.java:477)
> > at
> >
> org.apache.struts2.dispatcher.FilterDispatcher.doFilter (FilterDispatcher.java:467)
> > at
> >
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:235)
> > at
> >
> org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:206)
> > at
> >
> org.apache.catalina.core.StandardWrapperValve.invoke (StandardWrapperValve.java:233)
> > at
> >
> org.apache.catalina.core.StandardContextValve.invoke (StandardContextValve.java:175)
> > at
> >
> org.apache.catalina.core.StandardHostValve.invoke (StandardHostValve.java:128)
> > at
> >
> org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:102)
> > at
> >
> org.apache.catalina.core.StandardEngineValve.invoke (StandardEngineValve.java:109)
> > at
> >
> org.apache.catalina.connector.CoyoteAdapter.service (CoyoteAdapter.java:286)
> > at
> >
> org.apache.coyote.http11.Http11Processor.process (Http11Processor.java:844)
> > at
> >
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
> > at
> > org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
> > at java.lang.Thread.run (Thread.java:619)
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
©2008 gg3721.com - Jax Systems, LLC, U.S.A.