Craig McClanahan,may I've your attention plz? (response wrapping)

2003-09-07 Thread David Anderson
Hi,

Referring to my previous post :
http://nagoya.apache.org/eyebrowse/[EMAIL PROTECTED]msgNo=88189
I think Jitesh Vidhani had a similar problem, he received no answer, this is 
what he wrote, and I think I share the same case, my question is :
is there something wrong in that code (or the one in my previous post) in 
order to wrap response object with struts/tiles ?  , is this has to do with 
flush=true in tiles:insert ? or is there any limitations for wrapping 
response in struts framework?, I'll appreciate if anybody has similar 
requirments and he did achieve any succssess, I feel like shooting in the 
dark.. :)

Thanks in advance..
David
From: Jitesh Vidhani [EMAIL PROTECTED]
Subject: Problem writing a Filter with Struts
Date: Fri, 31 May 2002 11:49:13 -0700
Content-Type: text/plain;
charset=iso-8859-1
Hi all,

I am trying to write a Filter around my struts layer.

Basically what I want to achieve is that when the User tries to go to a
particular URL, I make him go through the Filter. The filter calls
chain.doFilter() and I then I check to see if the ActionBean has set up a
particular attribute in the request. If it has been set then the Filter
modifies the response and outputs a different HTML onto the client.
Heres the code snippet from my Filter:

ServletOutputStream out = response.getOutputStream();
ResponseWrapper wrapper = new
ResponseWrapper((HttpServletResponse)response);
chain.doFilter(request, wrapper);
if(request.getAttribute(Modify)!=null)
{
CharArrayWriter caw = new CharArrayWriter();
caw.write(htmlbodyTHIS IS THE MODIFIED 
PAGE/body/html);
response.setContentLength(caw.toString().length());
out.print(caw.toString());
}
else
byte[] bytes = wrapper.toByteArray();
System.out.println(About to add:  + String.valueOf(bytes.length) 
+ 
bytes to the stream:  + new String(bytes));
out.write(bytes);
response.setContentLength(bytes.length);
}
response.setContentType(text/html);
out.flush();
out.close();
I have a wrapper wherein I extend the HttpServletResponseWrapper and use a
ByteArrayOutoutStream and I have overridden the getWriter() and the
getOutputStream() methods of the HttpServletResponseWrapper.
Now when I try to use this URL in the client browser then I somehow see an
Empty page irrespective of whether the request attribute has been set or
not. I also tried to print the Bytes from the wrapper that I am writing out
to the response's ServletOutputStream and it seems to be right.
I have written a small test servlet and the Filter works just fine with that
Servlet.
I am not able to figure out where I am going wrong. Any help would be
appreciated.
Thanks,
Jitesh
_
Help STOP SPAM with the new MSN 8 and get 2 months FREE*  
http://join.msn.com/?page=features/junkmail

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


Why is No getter method for property happening... damn.

2003-09-07 Thread Fumitada Hattori
Hi gurus,

I got a simple bean below.

public class Company {
   private static ArrayList list;
   private int id;
   private String name;

   static{
  list = new ArrayList();
  list.add(new Company(0,));
  list.add(new Company(1,MS));
  list.add(new Company(2,SUN));
  list.add(new Company(3,IBM));
  list.add(new Company(4,SYBASE));
   }

   public Company(){}

   public Company(int id, String name){
  this.id = id;
  this.name = name;
   }

   public int getId(){
  return id;
   }

   public String getName(){
  return name;
   }

   public static ArrayList getList(){
  return list;
   }
}
---

This bean is set into the application scope at tomcat starts.
sc.getServletContext().setAttribute(company,new Company());

In jsp, I try to get the bean like this.
logic:iterate id=id name=company property=list scope=application
   bean:write name=id property=name/BR
/logic:iterate

It's supposed to be showen like
MS
SUN
IBM
SYBASE

but I get the following error.
org.apache.jasper.JasperException: No getter method for property list of bean
company

why ?? I cannot figure out...damn.

Thanks in advance.




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



Re: Why is No getter method for property happening... damn.

2003-09-07 Thread Fumitada Hattori
Hi,

I fixed it.
It was becuase the method getList() was a staic method.

Thanks.




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



RE: [SCAFFOLD] AccessBase, createKey and ResultSetMetaData JDBC d rive r problems

2003-09-07 Thread aies22
Thanks Ted,

As always your advice was most helpful!!! 

The iBATIS DB layer package is great, though I'd rather stay with Scaffold
version for DAO.

BTW, some of the scaffold links on your site (husted.com) are currently not
working.

Noam

-Original Message-
From: Ted Husted [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 04, 2003 12:48 PM
To: Struts Users Mailing List
Subject: Re: [SCAFFOLD] AccessBase, createKey and ResultSetMetaData JDBC
drive r problems


Those utilities was originally developed using an older MySQL driver and 
may not be up to date. If you continue to have problems, my best advice 
is to have a look at the iBATIS DB layer www.ibatis.com, which uses 
the same approach to data access.

-Ted.

[EMAIL PROTECTED] wrote:
 Hi,
 
 When using the scaffold AccessBase.createKey() method, to get a simple
 integer field from the database, I get a java.lang.ClassCastException:
 java.lang.Long. 
 
 Looking at the log file, I find the following error message:
 
 Driver doesn't support strong ResultSetMetaData,  and PoolMan
subsequently
 failed an attempt to fabricate  a table name in spite of the driver
 limitations.
 
 Am using Poolman, Resin, Struts 1.1, J/connector, MySQL.
 
 It has obviously a JDBC driver problem.
 
 Has anyone come across this? Any ideas 
 
 Thanks,
 Noam
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

-- 
Ted Husted,
   Junit in Action  - http://www.manning.com/massol/,
   Struts in Action - http://husted.com/struts/book.html,
   JSP Site Design  - http://www.amazon.com/exec/obidos/ISBN=1861005512.



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



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



RE: [OT] HTTP 404 Not Found on Actions - SOLVED

2003-09-07 Thread Holman, Cal
Johan I use the default Tomcat 5.0.9 jk2.properties - which defines nothing allowing 
all the defaults to be used.  Then in the Tomcat server.xml you need to enable jk2.


!-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 --
Connector port=8009 
   enableLookups=false redirectPort=8443 debug=0
   protocol=AJP/1.3 / 


The workers2.properties in Apache 2.0.45 is where any real changes are made.  Here is 
the top part.  I use a /do/ strategy instead of .do.

[shm]
file=${serverRoot}/logs/shm.file
size=1048576

# Example socket channel, override port and host.
[channel.socket:localhost:8009]
#port=8009
#host=127.0.0.1
info=Ajp13 forwarding over socket
tomcatId=localhost:8009


# define the worker
#[ajp13:localhost:8009]
#channel=channel.socket:localhost:8009

# Uri mapping
[uri:/holmansite/do/*]
info=Map the actions to webapp

[uri:/holmansite/j_security_check/*]
info=Map the security request to tomcat

Here is the httpd.conf entry for the same domain.  I use the war as the container for 
all source but Tomcat only serves up the /do/ requests and Apache handles the rest.

VirtualHost *

ServerName www.calandva.com

DocumentRoot web/holmansite/

ServerAdmin [EMAIL PROTECTED]

ErrorLog logs/error_logs/holmansite-error.log
CustomLog logs/access_logs/holmansite-access.log combined

# Create an Alias for Holmansite
Alias /holmansite/ C:/Apache/Tomcat/webapps/holmansite/


/VirtualHost


Cal 

http://www.calandva.com/Last update 08/01/03


-Original Message-
From: Johan Wasserman - CPX Mngd Services [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 19, 2003 01:51
To: Struts Users Mailing List
Subject: RE: HTTP 404 Not Found on Actions - SOLVED

Nope, nothing to do with struts!  It's something to do with how Tomcat /
Apache is set up.  When I try via Tomcat only it works.  I'll have to
relook the Tomcat/Apache thing (mod_jk), if ANYBODY has a tried and
trusted way of setting this up, please let me know.

Tomcat v.  5.0.3
Apache v. 2.0.46

Sory for this out of context.

Thanks,
Johan.

-Original Message-
From: Koni Roth [mailto:[EMAIL PROTECTED]
Sent: Monday, August 18, 2003 12:41 PM
To: Struts Users Mailing List
Subject: Re: HTTP 404 Not Found on Actions


Try struts 1.1 final version. Here it works ;-)

Johan Wasserman - CPX Mngd Services wrote:

 Hi.
 I'm running struts 1.1-rc2 and get a 404 when entering an unrecognized

 username  password on the logon page for struts-example (Mailreader
 demo).  It goes to localhost/sruts-example/logon.do but with a 404
 Page not found.  I've checked and double checked my web 
 struts-config files, I mean they've not been changed from the
 download.

 Thanks,
 Johan Wasserman.




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


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

  
Learn more about Paymentech's payment processing services at www.paymentech.com
THIS MESSAGE IS CONFIDENTIAL.  This e-mail message and any attachments are proprietary 
and confidential information intended only for the use of the recipient(s) named 
above.  If you are not the intended recipient, you may not print, distribute, or copy 
this message or any attachments.  If you have received this communication in error, 
please notify the sender by return e-mail and delete this message and any attachments 
from your computer.

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



RE: Problem with tiles and protected jsps

2003-09-07 Thread Holman, Cal
Wes I accomplished Form based auth by defining a security constraint in web.xml for 
the Action path.

web-resource-collection
web-resource-nameSecurePages/web-resource-name
descriptionSecurity constraint for Admin/description
url-pattern/do/secure/*/url-pattern
http-methodPOST/http-method
http-methodGET/http-method
/web-resource-collection


Cal 

http://www.calandva.com/Last update 08/01/03


-Original Message-
From: Wes Kubo [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 02, 2003 11:56
To: Struts Users Mailing List
Subject: Problem with tiles and protected jsps

I originally had my jsps under WEB-INF to prevent them from direct access,
which worked just fine. However, the standards I'm working with dictate that
the jsps be located above WEB-INF. In order to prevent access to my jsps I
added a security-constraint in web.xml, blocking access to the jsps.
Unfortunately, now none of my tiles display properly, instead I get the
error message:

[Exception in:/jsp/body/home_body.jsp] Response has already been committed

for all the protected pages. The problem is that for each protected page,
its trying to authenticate the user using the FORM authentication that I
have set-up for parts of the application (this is a separate
security-constraint from the jsp protection). All I want to prevent is
direct access to the jsp, not access through other means (e.g. action/tile).

Thanks.

Wes


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

  
Learn more about Paymentech's payment processing services at www.paymentech.com
THIS MESSAGE IS CONFIDENTIAL.  This e-mail message and any attachments are proprietary 
and confidential information intended only for the use of the recipient(s) named 
above.  If you are not the intended recipient, you may not print, distribute, or copy 
this message or any attachments.  If you have received this communication in error, 
please notify the sender by return e-mail and delete this message and any attachments 
from your computer.

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



Icon?

2003-09-07 Thread Bjørn T Johansen
I am trying to customize the icon my webapp is using by adding 

icon
  small-icon
path-to-icon
  /small-icon
/icon

in my web.xml file, but nothing happens. What am I overlooking?


Regards,

BTJ


Searching facility questions

2003-09-07 Thread Marco Tedone
Ok, let's say that I would like to translate system's specific URLs (i.e.
D:\Tomcat\webapps\foo\foo\bar.jsp and so on...) into  web-context specific
URLs (i.e. http://myServer/foo/foo/bar.jsp). Well, if I immagine to replace
D:\Tomcat\webapps with http://myServer things seem quite easy. My first
question is: did anyone encountered this problem before?

Secondly a JSP page not necessarily can be
executed without passing from a Struts Action (i.e. an Action prepared some
data to display, and if we try to access the JSP directly we could have some
bad 5 minutes), so my question is: did anyone encountered this kind of
problem? Did you find any solution? For this second subject, I could think
to a sort of mapping file between JSPs and relevant actions, so that we can
assume that if the user clicks on a JSP link, instead the relevant action
for that JSP will be executed and then the JSP displayed. The mainteinance
for this solution seems CRAP.

Hope someone of you will help,

Marco




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



Script variables as keys for mapped properties

2003-09-07 Thread Ross Sargant
Hi,
 I want to use a script variable as a key for mapped property access.
I am trying to render an options list of provinces based on the current country id 
defined in my form bean. 

First I define it with

bean:define id=currentCountryId name=companyDetailsForm property=countryId 
type=java.lang.String/

This seems to work  ok as
%=CountryId:+currentCountryId% is displaying the correct value.

However I can't seem to use this value as a key. 

html:optionsCollection name=usercontainer 
property=countryProvinceHelper.provinces(%=currentCountryId%) label=displayLabel 
value=id/

The generated servlet code is just using the entire string as is rather then putting 
in a reference to value of the script variable.
I'm not clear on the syntax I need to make this work.






Permanent forms

2003-09-07 Thread Emmanuel Potvin
Hi, I work on a struts site who administer my company suppliers. So the goal
of the site is to modify suppliers settings. I want to make the supplierForm
object in my session scope and don’t let struts reset him after each action.
To make this, I added a property named permanent to my form. And in my reset
method, I reset each property only if the permanent boolean property is set
to false. 

 

It’s works, but for my boolean properties modified by checkboxes, struts
needs to reset these properties before changing them. With my modification,
they stay activated even if I uncheck them. So my solution is now a problem.
How can I solve these 2 problems with only one solution?

 

Emmanuel Potvin

Les consultants Parent et associés inc.

(418)802-8439

 



Re: Permanent forms

2003-09-07 Thread Yann Cébron

It's works, but for my boolean properties modified by checkboxes, struts
needs to reset these properties before changing them. With my modification,
they stay activated even if I uncheck them. So my solution is now a
problem.
How can I solve these 2 problems with only one solution?

http://jakarta.apache.org/struts/faqs/newbie.html#reset - this is the
definitive way to handle boolean properties with ActionForms

Also search the user list - this is one of the top #10 discussion items
here..

Cheers

Yann




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



RE: How to click on a button to link to a page?

2003-09-07 Thread hari_s
You can give the submit button different value, with the same property
Then you validate it in your ActionClass and mapping it in
struts-config.xml

-Original Message-
From: Rick Col [mailto:[EMAIL PROTECTED] 
Sent: Saturday, September 06, 2003 2:43 AM
To: [EMAIL PROTECTED]
Subject: How to click on a button to link to a page?

Hi,

If I have a go button like this:

html:submitbean:message
key=button.go/html:submit

once I click on this button, I want it to go to
another jsp page sample.jsp. How can I do that? Is it
possible to use html:link to do the job?

regards,



__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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


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



Create new nested bean instance

2003-09-07 Thread Nate Drake
Hi,

What is the proper Struts way to implement create/update pages in the
following scenario.

You've got a Customer Form bean with the following properties:

- First Name
- Last Name
- List of PhoneNumber Beans

A PhoneNumber bean with these properties:

- Country Code
- Area Code
- Number
- Description


I'd like it to be set up like this:

CreateCustomer.jsp has text fields for first and last name, and it
displays the list of added phone numbers.  It also has an Add New Phone
Number link.  This link takes you to AddPhoneNumber.jsp.  This page has
fields for all the phone number properties, and an Add button.  When
you press the Add button it returns you to the CreateCustomer.jsp. 
The list of phone numbers on this page will reflect the newly added
phone number.

The part of this I'm having trouble figuring out is how the List of
phone number beans gets updated.  Is there a way to tell Struts to add a
new PhoneNumberBean to CustomerBean's list of phone numbers?  Or do I
have to do it myself in an Action?

I haven't been able to find any examples like this with nested beans. 
All the nested examples I find just show you how to display nested
data.  I need to create new nested data and add it to the parent.

Any help would be greatly appreciated.

Thanks,

Nate


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



Re: Icon?

2003-09-07 Thread Max Cooper
Two things come to mind:

1. Do you want an icon that will show up in a browser when a user accesses
your application/site? If so, you need to do something else -- the icon
part of the servlet spec seems to indicate that it is for GUI tools (like
your app server's management console) rather than for browser access to the
webapp itself. I am not totally sure about this as I have not tried it
myself, but that is my impression from reading the servlet spec.

2. Is the icon element in the right place in the web.xml file? An editor
that does XML validation (like IntelliJ IDEA and other IDEs and XML editors)
is very helpful for pointing out such errors.

-Max

- Original Message - 
From: Bjrn T Johansen [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Sunday, September 07, 2003 8:44 AM
Subject: Icon?


 I am trying to customize the icon my webapp is using by adding

 icon
   small-icon
 path-to-icon
   /small-icon
 /icon

 in my web.xml file, but nothing happens. What am I overlooking?


 Regards,

 BTJ




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



RE: request.getContextPath();

2003-09-07 Thread Mohd Amin Mohd Din
PostGraduate is still in development, WEB-INF is mapped from the IDE.
Anyway, tried the request.getContextPath() on other pages with forms,
works well.



-Original Message-
From: Navjot Singh [mailto:[EMAIL PROTECTED] 
Sent: Friday, September 05, 2003 6:31 PM
To: Struts Users Mailing List
Subject: RE: request.getContextPath();

but this your contextPath. so, request returns that string that you set.

Is PostGraduate.war your file name?
or in server.xml you have set contextPath=/PostGraduate.

navjot
|-Original Message-
|From: Mohd Amin Mohd Din [mailto:[EMAIL PROTECTED]
|Sent: Friday, September 05, 2003 1:44 PM
|To: [EMAIL PROTECTED]
|Subject: request.getContextPath();
|
|
|Hi,
| 
|Having a wired problem here. On some of my pages, the
|request.getContextPath() works great, but on other pages, it doesn't
|seem to work, it only gets the webapp. Eg.
|page is in
|http://192.168.1.111:8080/PostGraduate/admission/application/listProfil
e
|Setup
|http://192.168.1.111:8080/PostGraduatte/admission/application/listProf
i
|leSetup  i'm only receiving a PostGraduate/ when I do a
|request.getContextPath();
| 
| 
|Thanks in advance
|Amin
| 
|

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




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