Java Mailing List Archive

http://www.junlu.com/

Google
Google
Mailing List
Home
Forum Home
JBoss - Java Application Server
Tomcat - JSP/Servlet container
Struts - A MVC web framework
iText - An open source PDF Java Library
JDOM - JDOM XML Parser
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
JSP - A mailing list about Java Server Pages specification and reference
J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog
Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology
Struts & Hibernate
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Oracle Connection Pooling in 3 2 2
Servlet : Session invalidate
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Tomcat and webapplication specific java library path
Running a Simple JMS Example
Mapping in workers2 properties
org apache jasper JasperException
Cannot find message resources under key org apache struts action
   MESSAGE
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
url string for connecting jboss to oracle
Value attribute of <html:checkbox
javax servlet ServletException: BeanUtils populate
HTTP Status 404 The requested resource is not available
5 0 18: Windows XP Pro vs Windows 2000
 
R: Reading generated html

R: Reading generated html

2007-01-24       - By Marcello Savino

 Back
Reply:     1     2     3  

As you can see (value="<%=request%>") the data setted is jsp is not of type
string.
I'm pretty sure cause i use to pass the request object to an other similar bean
(with other purpose) and it works fine !

Anyway thanks for your attention


Marcello Savino
ALDEBRA S.p.A.
tel.  0461302441

-- --Messaggio originale-- --
Da: Kandelwal Abhishek [mailto:Abhishek.Kandelwal@(protected)]
Inviato: mercoled? 24 gennaio 2007 13.15
A: Struts Users Mailing List
Oggetto: RE: Reading generated html

Hi dear,

I guess the method setHtml(HttpServletRequest request) is not called because
the data u r setting from JSP is of type String but the bean method parameter
takes HttpServletRequest. So change the parameter type to String instead of
HttpServletRequest.

Hope it will solve the problem.

Thanks & Regards
Abhishek Khandelwal


-- --Original Message-- --
From: Marcello Savino [mailto:Marcello.Savino@(protected)]
Sent: Wednesday, January 24, 2007 5:16 AM
To: Struts Users Mailing List
Subject: Reading generated html


Hi all.
I need to read in a Bean the generated html (i mean the one interpreted by the
browser).
Let me explain further:
In a jsp file i've this piece of code:

[...]
<html:form action="/someAction">
[...]
<jsp:useBean id="myObj" class="util.Test" scope="request">
  <jsp:setProperty name="myObj" property="html"
value="<%=request%>"></jsp:setProperty>
</jsp:useBean>
[...]
</html:form>
[...]

This is the bean:

package util;
import javax.servlet.http.HttpServletRequest Source code of javax.servlet.http.HttpServletRequest;
import javax.servlet.ServletInputStream Source code of javax.servlet.ServletInputStream; import java.io.InputStreamReader Source code of java.io.InputStreamReader;
import java.io.BufferedReader Source code of java.io.BufferedReader;; public class Test {

  public Test(){
  }
  public void setHtml(HttpServletRequest request){
    StringBuffer HTMLStr=new StringBuffer("");    
    ServletInputStream content=request.getInputStream();
    BufferedReader br = new BufferedReader(new InputStreamReader(content));
    HTMLStr.append(br.readLine());
  }
}

But i get no HTML string, always get a null string !
I suppose the bean method is invoked before tha page was rendered, but i can
figure out how invoke the bean after.
Even an alternative approach will be intersting for me.

Any help will be greatly appreciated
Thanks in advance

Marcello Savino
ALDEBRA S.p.A.
tel.  0461302441

-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
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)


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


©2008 junlu.com - Jax Systems, LLC, U.S.A.