You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Dhandapani Ponnurangam <in...@gmail.com> on 2008/05/15 13:40:50 UTC

Struts2 Vs ExtJs - support and coexistence?

Hi

I am trying to integrate ExtJs into Struts2 framework.
Couldnt see my .html files rendering with ExtJs stuff...

Can somebody throw light on this?
How can i do about this?

Thanks,
Dhandapani

RE: Struts validator framework

Posted by "Givler, Eric" <eg...@state.pa.us>.
You define the field label using an argument, i.e.
 
<field property="username" depends="required">
        <arg0 key="prompt.username"/>
</field>
 
So the validator is using the field's label to fill in the message.  The default message for errors.required is:
errors.required={0} is required.
 
So, it will replace {0} with the prompt.username entry that also appears as a resource.
 
To display the error next to the field, you could place an <html:errors property="username" /> next to the field.  IF you do this though, realize that Struts is going to place the errors.header, errors.footer, errors.prefix and errors.suffix around the items.  If you use the defaults that would not look right next to a field - fine for the top of the page, but not for a field.  You'll have to change them.
 
Otherwise, you could use an <html:messages> tag specific for that field and then format the html yourself as it iterates one (or possibly several) error messages for each field.
 
Good luck,
Eric

	-----Original Message----- 
	From: Zhang, Larry (L.) [mailto:lzhang20@ford.com] 
	Sent: Thu 5/15/2008 6:14 PM 
	To: Struts Users Mailing List 
	Cc: 
	Subject: Struts validator framework
	
	

	
	Say if I have two text fields, one label is Please enter name:, and the
	other label is Please enter SSN:. In struts validator framework, if I
	need to validate these two fields using required validator, is there any
	way to relate the field label to the message? Or does struts validator
	support displaying the validation message right next to the field (so
	that the user easily know which fields are invalid)?
	
	Thank you very much.
	
	---------------------------------------------------------------------
	To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
	For additional commands, e-mail: user-help@struts.apache.org
	
	


Struts validator framework

Posted by "Zhang, Larry (L.)" <lz...@ford.com>.
 
Say if I have two text fields, one label is Please enter name:, and the
other label is Please enter SSN:. In struts validator framework, if I
need to validate these two fields using required validator, is there any
way to relate the field label to the message? Or does struts validator
support displaying the validation message right next to the field (so
that the user easily know which fields are invalid)?

Thank you very much.

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


Re: Struts2 Vs ExtJs - support and coexistence?

Posted by Frans Thamura <fr...@meruvian.org>.
plz compare with json-plugins

which send the POJO become JSON, without have to code this long lines

F

On Fri, May 16, 2008 at 12:15 AM, Rafael Antunes <ra...@gmail.com>
wrote:

> Example:
>
> <%@ page contentType="text/html; charset=UTF-8"%>
> <%@ taglib prefix="s" uri="/struts-tags"%>
> <%@ taglib prefix="json" uri="http://www.atg.com/taglibs/json"%>
>
> <json:object name="mylink">
>    <json:array name="mylink" var="obj" items="${linkList}">
>        <json:object>
>            <json:property name="idLink" value="${obj.id}" />
>            <json:property name="name" value="${obj.name}" />
>            <json:property name="description" value="${obj.description}" />
>            <json:property name="url" value="${obj.url}" />
>            <json:property name="categoryName" value="${obj.category.name}"
> />
>            <json:property name="countryName" value="${obj.country.name}"
> />
>            <json:property name="cityUf" value="${obj.city.state.name}" />
>            <json:property name="address" value="${obj.address}" />
>            <json:property name="bairro" value="${obj.zone}" />
>            <json:property name="cityName" value="${obj.city.name}" />
>            <json:property name="number" value="${obj.number}" />
>            <json:property name="cityName2" value="${obj.cityname}" />
>            <json:property name="cep" value="${obj.cep}" />
>            <json:property name="phone" value="${obj.phone}" />
>            <json:property name="email" value="${obj.email}" />
>            <json:property name="enable" value="${obj.enable}" />
>            <json:property name="idcity" value="${obj.city.id}" />
>            <json:property name="idcountry" value="${obj.country.id}" />
>            <json:property name="idcategory" value="${obj.category.id}" />
>        </json:object>
>    </json:array>
> </json:object>
>
> In ext you have a json object with name mylink with fill values.
>
> 2008/5/15 Frans Thamura <fr...@meruvian.org>:
>
> > On Thu, May 15, 2008 at 7:44 PM, Rafael Antunes <
> rafael.araujodf@gmail.com
> > >
> > wrote:
> >
> > > You need json-lib-*.*.jar and json-taglib*.*.jar, the tag lib
> "transform"
> > > the java object in json objects.
> > >
> >
> > we use the JSON Plugins,
> >
> > i still dont know how to make the result output as JSON using json-lib
> >
> > i am know very close the json-lib creator
> >
> > any glue friend
> >
> > F
> >
>
>
>
> --
>
> ---------------------------------------------
> Rafael Antunes Torquato Araujo
>



-- 
-- 
Frans Thamura
Director
Meruvian
Redefining Civilization
Indonesia

Education, Consulting, Networking, Profesional Marketplace, OpenSource
Development and Implementation

Mobile: +62 855 7888 699
Skype: fthamura
YM: fthamura@yahoo.com
GoogleTalk: frans@meruvian.org
MSN: fthamura@hotmail.com

Sun Java Champion
Oracle Ace Director
JEDI Indonesia / JENI Team
JUG Indonesia Founder
jTechnopreneur Community Founder

Blogs:
http://www.jroller.com/fthamura (English)
http://www.nagasakti.or.id/roller/page/fthamura (Indonesia : Motivation Blog

Linkedin: http://www.linkedin.com/in/fthamura

Re: Struts2 Vs ExtJs - support and coexistence?

Posted by Rafael Antunes <ra...@gmail.com>.
Example:

<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="json" uri="http://www.atg.com/taglibs/json"%>

<json:object name="mylink">
    <json:array name="mylink" var="obj" items="${linkList}">
        <json:object>
            <json:property name="idLink" value="${obj.id}" />
            <json:property name="name" value="${obj.name}" />
            <json:property name="description" value="${obj.description}" />
            <json:property name="url" value="${obj.url}" />
            <json:property name="categoryName" value="${obj.category.name}"
/>
            <json:property name="countryName" value="${obj.country.name}" />
            <json:property name="cityUf" value="${obj.city.state.name}" />
            <json:property name="address" value="${obj.address}" />
            <json:property name="bairro" value="${obj.zone}" />
            <json:property name="cityName" value="${obj.city.name}" />
            <json:property name="number" value="${obj.number}" />
            <json:property name="cityName2" value="${obj.cityname}" />
            <json:property name="cep" value="${obj.cep}" />
            <json:property name="phone" value="${obj.phone}" />
            <json:property name="email" value="${obj.email}" />
            <json:property name="enable" value="${obj.enable}" />
            <json:property name="idcity" value="${obj.city.id}" />
            <json:property name="idcountry" value="${obj.country.id}" />
            <json:property name="idcategory" value="${obj.category.id}" />
        </json:object>
    </json:array>
</json:object>

In ext you have a json object with name mylink with fill values.

2008/5/15 Frans Thamura <fr...@meruvian.org>:

> On Thu, May 15, 2008 at 7:44 PM, Rafael Antunes <rafael.araujodf@gmail.com
> >
> wrote:
>
> > You need json-lib-*.*.jar and json-taglib*.*.jar, the tag lib "transform"
> > the java object in json objects.
> >
>
> we use the JSON Plugins,
>
> i still dont know how to make the result output as JSON using json-lib
>
> i am know very close the json-lib creator
>
> any glue friend
>
> F
>



-- 

---------------------------------------------
Rafael Antunes Torquato Araujo

Re: Struts2 Vs ExtJs - support and coexistence?

Posted by Frans Thamura <fr...@meruvian.org>.
On Thu, May 15, 2008 at 7:44 PM, Rafael Antunes <ra...@gmail.com>
wrote:

> You need json-lib-*.*.jar and json-taglib*.*.jar, the tag lib "transform"
> the java object in json objects.
>

we use the JSON Plugins,

i still dont know how to make the result output as JSON using json-lib

i am know very close the json-lib creator

any glue friend

F

Re: Struts2 Vs ExtJs - support and coexistence?

Posted by Rafael Antunes <ra...@gmail.com>.
You need json-lib-*.*.jar and json-taglib*.*.jar, the tag lib "transform"
the java object in json objects.

2008/5/15 Frans Thamura <fr...@meruvian.org>:

> On Thu, May 15, 2008 at 6:40 PM, Dhandapani Ponnurangam <
> inspiregates@gmail.com> wrote:
>
> > Hi
> >
> > I am trying to integrate ExtJs into Struts2 framework.
> > Couldnt see my .html files rendering with ExtJs stuff...
> >
> > Can somebody throw light on this?
> > How can i do about this?
> >
>
> we are working with it, we can see that to integrate we need JSON plugins
>
> but i am still have problem with SMD example here
>
> F
>



-- 

---------------------------------------------
Rafael Antunes Torquato Araujo

Re: Struts2 Vs ExtJs - support and coexistence?

Posted by Frans Thamura <fr...@meruvian.org>.
On Thu, May 15, 2008 at 6:40 PM, Dhandapani Ponnurangam <
inspiregates@gmail.com> wrote:

> Hi
>
> I am trying to integrate ExtJs into Struts2 framework.
> Couldnt see my .html files rendering with ExtJs stuff...
>
> Can somebody throw light on this?
> How can i do about this?
>

we are working with it, we can see that to integrate we need JSON plugins

but i am still have problem with SMD example here

F