You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by lixin chu <li...@yahoo.com> on 2004/01/24 02:43:04 UTC

generating tables in Struts

Hi,
I found the Display Tag which is really nice. However,
it has a couple of problems:

1. 'export' display data in the Tile not exporting to
a file - w/o Tiles it is fine.

2. I need a column of Checkbox, but the status is not
kept after sorting.

Does anyone know if there is another package handling
the table in struts+Tiles with similar functionalities
but supporting checkbox ?

thanks
li xin

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/

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


RE: generating tables in Struts

Posted by Mohan Radhakrishnan <mr...@cellexchange.com>.
Unintentional Wrong subject again. 

Mohan

-----Original Message-----
From: Mohan Radhakrishnan [mailto:mradhakrishnan@cellexchange.com]
Sent: Saturday, January 24, 2004 12:23 PM
To: 'Struts Users Mailing List'
Subject: RE: generating tables in Struts 


Hi
	Is there any way to find out what action is current by overriding methods
like 'processForwardConfig' etc. and call a method in that action. I am
using Tiles. So my custom processor extends the Tile processor.

The business case for this is not worth explaining because I am doing this
to avoid changing
code written by somebody.

Mohan


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


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


RE: generating tables in Struts

Posted by Mohan Radhakrishnan <mr...@cellexchange.com>.
Hi
	Is there any way to find out what action is current by overriding methods
like 'processForwardConfig' etc. and call a method in that action. I am
using Tiles. So my custom processor extends the Tile processor.

The business case for this is not worth explaining because I am doing this
to avoid changing
code written by somebody.

Mohan


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


Re: ServletContext/Cluster

Posted by "John D. Hume" <jo...@subres.net>.
It doesn't mean it's useless, just that it's not useful as a place to 
store global information.  It's still a good place to store things that 
you only want one of per server. 



Mohan Radhakrishnan wrote:

>Hi
>   I read the following spec. This means that in a clustered environment the
>application scope
>is useless. I can't really believe this. Why do we have this scope then ?
>
>Mohan
>
>
>The Server Specification states the following:
>
>"javax.servlet
>Interface ServletContext
>
>----------------------------------------------------------------------------
>----
>
>public abstract interface ServletContext
>Defines a set of methods that a servlet uses to communicate with its servlet
>container, for example, to get the MIME type of a file, dispatch requests,
>or write to a log file.
>
>There is one context per "web application" per Java Virtual Machine. (A "web
>application" is a collection of servlets and content installed under a
>specific subset of the server's URL namespace such as /catalog and possibly
>installed via a .war file.)
>
>In the case of a web application marked "distributed" in its deployment
>descriptor, there will be one context instance for each virtual machine. In
>this situation, the context cannot be used as a location to share global
>information (because the information won't be truly global). Use an external
>resource like a database instead.
>
>The ServletContext object is contained within the ServletConfig object,
>which the Web server provides the servlet when the servlet is initialized. "
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
>
>
>  
>

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


Re: ServletContext/Cluster

Posted by "Craig R. McClanahan" <cr...@apache.org>.
Quoting Mohan Radhakrishnan <mr...@cellexchange.com>:

> Hi
>    I read the following spec. This means that in a clustered environment the
> application scope
> is useless.

Not true at all.

. I can't really believe this. Why do we have this scope then ?
> 

A primary purpose for appication scope variables is to store an in-memory cache
of read-only data that is repeatedly used, but is shared across all users (for
example, an array of LabelValueBeans containing U.S. state appreviations and
their corresponding names).  Typically, the data for such a cache is loaded
(from a database, or from properties files, or whatever) either at application
startup, or lazily loaded the first time it's requested.

This approach works fine in either a single-server or multi-server environment,
and will improve the response time of your application (by avoiding repeated
database loads of the same data) in either scenario.  The fact that the same
physical instance of the in-memory objects is not shared doesn't matter -- an
appication receives the right data value no matter which server instance it is
running inside, because all the copies are duplicates.

For non-read-only-shared-data scenarios, you need to heed Section SRV.3.4.1:

    When information needs to be shared between
    servlets running in a distributed environment,
    the information should be placed into a session
    (see Chapter SRV.7, "Sessions"), stored in a
    database, or set in an Enterprise JavaBeans component.

For other issues related to running applications in a distributed environment,
see SRV.2.2 and SRV.7.7.2.  One of the most important features of session
management is that the container is *required* to serve multiple simultaneous
requests for the same session from the same server instance -- if the server
supports session migration, that can only occur "in between" requests.  Thus,
your application can be assured that the same session will not be accessed from
two server instances at the same time, which makes sessions a good place to put
mutable data that needs to be available no matter where the session is moved. 
Of course, such session attributes also have to be Serializable, but that is
generally pretty easy.

> Mohan
> 

Craig McClanahan



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


ServletContext/Cluster

Posted by Mohan Radhakrishnan <mr...@cellexchange.com>.
Hi
   I read the following spec. This means that in a clustered environment the
application scope
is useless. I can't really believe this. Why do we have this scope then ?

Mohan


The Server Specification states the following:

"javax.servlet
Interface ServletContext

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

public abstract interface ServletContext
Defines a set of methods that a servlet uses to communicate with its servlet
container, for example, to get the MIME type of a file, dispatch requests,
or write to a log file.

There is one context per "web application" per Java Virtual Machine. (A "web
application" is a collection of servlets and content installed under a
specific subset of the server's URL namespace such as /catalog and possibly
installed via a .war file.)

In the case of a web application marked "distributed" in its deployment
descriptor, there will be one context instance for each virtual machine. In
this situation, the context cannot be used as a location to share global
information (because the information won't be truly global). Use an external
resource like a database instead.

The ServletContext object is contained within the ServletConfig object,
which the Web server provides the servlet when the servlet is initialized. "


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


RE: generating tables in Struts

Posted by lixin chu <li...@yahoo.com>.
have just tried Beta 2. the export feature is fixed
when the addition to the web.xml is added. 

I think even if sorting with a checkbox column is not
common but exporting a table with the additional
checkbox information is something not wanted.

Is there a fix ?


--- Matt Raible <li...@raibledesigns.com> wrote:
> The export/tiles issue has been fixed - you just
> needd to specify a
> filter in your web.xml.  
> 
> http://displaytag.sourceforge.net/install.html
> 
> If you need to export data from an included JSP
> page, such as from
> Struts, you should configure the
> ResponseOverrideFilter in your web.xml.
> (You do not need the filter if you do not use
> exports, or if you do not
> use the table tag from a jsp page that is included
> inside of another
> page.) Configure the Filter in your web.xml:
> 
>  <filter>
>   <filter-name>ResponseOverrideFilter</filter-name>
>  
>
<filter-class>org.displaytag.filter.ResponseOverrideFilter</filter-class
> >
>   </filter>
>   
> 
> And add mappings for the pages that you will
> intercept, for example:
> 
>   <filter-mapping>
>   <filter-name>ResponseOverrideFilter</filter-name>
>   <url-pattern>*.do</url-pattern>
>   </filter-mapping>
>   <filter-mapping>
>   <filter-name>ResponseOverrideFilter</filter-name>
>   <url-pattern>*.jsp</url-pattern>
>   </filter-mapping>
>   
> It's been broken in CVS for the past couple of
> weeks, but I just fixed
> it today.  You'll have to download and built it to
> get the latest fixes.
> 
> For #2, you could use JavaScript to grab the table
> and add links to the
> column titles that submit your form.  I've done this
> and it works fairly
> well - although in the end I decided the table
> didn't need any sorting.
> 
> HTH,
> 
> Matt
> 
> > -----Original Message-----
> > From: lixin chu [mailto:lixin_chu@yahoo.com] 
> > Sent: Friday, January 23, 2004 6:43 PM
> > To: struts-user@jakarta.apache.org
> > Subject: generating tables in Struts 
> > 
> > 
> > Hi,
> > I found the Display Tag which is really nice.
> However,
> > it has a couple of problems:
> > 
> > 1. 'export' display data in the Tile not exporting
> to
> > a file - w/o Tiles it is fine.
> > 
> > 2. I need a column of Checkbox, but the status is
> not
> > kept after sorting.
> > 
> > Does anyone know if there is another package
> handling
> > the table in struts+Tiles with similar
> functionalities
> > but supporting checkbox ?
> > 
> > thanks
> > li xin
> > 
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! SiteBuilder - Free web site building tool.
> Try it! 
> http://webhosting.yahoo.com/ps/sb/
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> struts-user-help@jakarta.apache.org
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> struts-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/

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


Validator

Posted by Mohan Radhakrishnan <mr...@cellexchange.com>.
Hi

         I have a problem with the validator framework. The procedure I am
following is

1. I have code like this in the form

	public ActionErrors validate(ActionMapping mapping, HttpServletRequest
request){
		System.out.println( "The requested operation is " + getOperation() );

		if( getOperation().equals( "showRuleByStatus") || getOperation().equals(
"addRule")
							|| getOperation().equals( "showRuleDetail") ||
getOperation().equals( "init")){
			return new ActionErrors();
		}
	return super.validate( mapping, request );
	}

2. My form extends BaseValidatorForm extends ValidatorForm

3. I have

  <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
    <set-property property="pathnames" value="/WEB-INF/validator-rules.xml,

/WEB-INF/rule_validation.xml"/>
  </plug-in>

in the config.

4. I have bean:message tags and resource properties file which is working.
5. I have 	  <html:errors property="errors.required" /> in the JSP.

My error messages never appear if I call any method other than those
mentioned in the validate method.


What could be the problem ?

Mohan


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


RE: generating tables in Struts

Posted by lixin chu <li...@yahoo.com>.
Thanks. 

So the fix will be in Beta 3 am I right?

by the way, will that also fix exporting checkbox
column ?

(I am using <display:control....> )

--- Matt Raible <li...@raibledesigns.com> wrote:
> The export/tiles issue has been fixed - you just
> needd to specify a
> filter in your web.xml.  
> 
> http://displaytag.sourceforge.net/install.html
> 
> If you need to export data from an included JSP
> page, such as from
> Struts, you should configure the
> ResponseOverrideFilter in your web.xml.
> (You do not need the filter if you do not use
> exports, or if you do not
> use the table tag from a jsp page that is included
> inside of another
> page.) Configure the Filter in your web.xml:
> 
>  <filter>
>   <filter-name>ResponseOverrideFilter</filter-name>
>  
>
<filter-class>org.displaytag.filter.ResponseOverrideFilter</filter-class
> >
>   </filter>
>   
> 
> And add mappings for the pages that you will
> intercept, for example:
> 
>   <filter-mapping>
>   <filter-name>ResponseOverrideFilter</filter-name>
>   <url-pattern>*.do</url-pattern>
>   </filter-mapping>
>   <filter-mapping>
>   <filter-name>ResponseOverrideFilter</filter-name>
>   <url-pattern>*.jsp</url-pattern>
>   </filter-mapping>
>   
> It's been broken in CVS for the past couple of
> weeks, but I just fixed
> it today.  You'll have to download and built it to
> get the latest fixes.
> 
> For #2, you could use JavaScript to grab the table
> and add links to the
> column titles that submit your form.  I've done this
> and it works fairly
> well - although in the end I decided the table
> didn't need any sorting.
> 
> HTH,
> 
> Matt
> 
> > -----Original Message-----
> > From: lixin chu [mailto:lixin_chu@yahoo.com] 
> > Sent: Friday, January 23, 2004 6:43 PM
> > To: struts-user@jakarta.apache.org
> > Subject: generating tables in Struts 
> > 
> > 
> > Hi,
> > I found the Display Tag which is really nice.
> However,
> > it has a couple of problems:
> > 
> > 1. 'export' display data in the Tile not exporting
> to
> > a file - w/o Tiles it is fine.
> > 
> > 2. I need a column of Checkbox, but the status is
> not
> > kept after sorting.
> > 
> > Does anyone know if there is another package
> handling
> > the table in struts+Tiles with similar
> functionalities
> > but supporting checkbox ?
> > 
> > thanks
> > li xin
> > 
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! SiteBuilder - Free web site building tool.
> Try it! 
> http://webhosting.yahoo.com/ps/sb/
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> struts-user-help@jakarta.apache.org
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> struts-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/

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


RE: generating tables in Struts

Posted by Matt Raible <li...@raibledesigns.com>.
The export/tiles issue has been fixed - you just needd to specify a
filter in your web.xml.  

http://displaytag.sourceforge.net/install.html

If you need to export data from an included JSP page, such as from
Struts, you should configure the ResponseOverrideFilter in your web.xml.
(You do not need the filter if you do not use exports, or if you do not
use the table tag from a jsp page that is included inside of another
page.) Configure the Filter in your web.xml:

 <filter>
  <filter-name>ResponseOverrideFilter</filter-name>
 
<filter-class>org.displaytag.filter.ResponseOverrideFilter</filter-class
>
  </filter>
  

And add mappings for the pages that you will intercept, for example:

  <filter-mapping>
  <filter-name>ResponseOverrideFilter</filter-name>
  <url-pattern>*.do</url-pattern>
  </filter-mapping>
  <filter-mapping>
  <filter-name>ResponseOverrideFilter</filter-name>
  <url-pattern>*.jsp</url-pattern>
  </filter-mapping>
  
It's been broken in CVS for the past couple of weeks, but I just fixed
it today.  You'll have to download and built it to get the latest fixes.

For #2, you could use JavaScript to grab the table and add links to the
column titles that submit your form.  I've done this and it works fairly
well - although in the end I decided the table didn't need any sorting.

HTH,

Matt

> -----Original Message-----
> From: lixin chu [mailto:lixin_chu@yahoo.com] 
> Sent: Friday, January 23, 2004 6:43 PM
> To: struts-user@jakarta.apache.org
> Subject: generating tables in Struts 
> 
> 
> Hi,
> I found the Display Tag which is really nice. However,
> it has a couple of problems:
> 
> 1. 'export' display data in the Tile not exporting to
> a file - w/o Tiles it is fine.
> 
> 2. I need a column of Checkbox, but the status is not
> kept after sorting.
> 
> Does anyone know if there is another package handling
> the table in struts+Tiles with similar functionalities
> but supporting checkbox ?
> 
> thanks
> li xin
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free web site building tool. Try it! 
http://webhosting.yahoo.com/ps/sb/

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


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