RE: problem in including file in INCLUDE TAG in jsp

2001-08-22 Thread Thai Thanh Ha
Title: AW: SilverStream behind firewall



Hi 
Anwar,

If you 
want to include dynamically, you should use this action

jsp:include 
page='%=sUrl %' 
flush="true"/

Regards,
Thai 


  -Original Message-From: Anwar Sadat 
  [mailto:[EMAIL PROTECTED]]Sent: Wednesday, August 22, 2001 
  5:21 PMTo: '[EMAIL PROTECTED]'Subject: 
  problem in including file in INCLUDE TAG in jsp
  Hi 
  all,
   I have a problem in including a html 
  file in the JSP file. 
  I 
  have a 2 jsp's. The first jsp has a submit button.
  When 
  i click on this submit button, I pass the filename as hidden 
  type.
  I 
  get this hidden variable in my next jsp.
  I will am trying to include this hidden variable in my 
  include tag.
  
  here is the code snippet.
  
  first JSP.
  
  form name=editPreferences method="post" 
  action="http://serverb/two.jsp"input type="submit" value="Edit 
  Preferences"input type="hidden" name="url" 
  value="/abc.htm"
  /form
  
  My second JSP 
  % String sUrl = request.getParameter("url"); 
  %
  
  %@ include file="%=sUrl%" 
  %
  
  
  Is this correct.. I am having problems in compiling 
  the second JSP..
  
  Kindly help me 
  regarding this. 
  Quick response is appreciated.
  
  Thanx in advance.
  
  Regards
  Anwar 
K


Indexed property of ActionForm

2001-06-25 Thread Thai Thanh Ha


I want to get value for an attribute named vehicleTypes in my ActionForm.
This is an array of Strings. But I don't know how to do it. Struts always
reports internel server error(500) when I  try to submit the form. Please
help me!

This is my ActionForm:
--
public final class SearchVehicleForm extends ActionForm {

private String[] vehicleTypes;
  
public String[] getVehicleTypes() {
return vehicleTypes;
}

public void setVehicleTypes(String[] vehicleTypes) {
this.vehicleTypes = vehicleTypes;
}
}


This is the exception from Tomcat's log file
---
2001-06-25 15:22:54 StandardWrapperValve[action]: Servlet.service() for
servlet action threw exception
javax.servlet.ServletException: BeanUtils.populate
at
org.apache.struts.util.RequestUtils.populate(RequestUtils.java:774)
at
org.apache.struts.action.ActionServlet.processPopulate(ActionServlet.java:20
61)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1563)
at
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:491)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:254)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:194)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:255)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:225)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2252)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164
)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:446)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:163)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at
org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:
875)
at
org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:952)
at java.lang.Thread.run(Thread.java:484)
- Root Cause -
java.lang.IllegalArgumentException: argument type mismatch
at java.lang.reflect.Method.invoke(Native Method)
at
org.apache.struts.util.PropertyUtils.setSimpleProperty(PropertyUtils.java:98
8)
at
org.apache.struts.util.PropertyUtils.setNestedProperty(PropertyUtils.java:90
4)
at
org.apache.struts.util.PropertyUtils.setProperty(PropertyUtils.java:932)
at org.apache.struts.util.BeanUtils.populate(BeanUtils.java:509)
at
org.apache.struts.util.RequestUtils.populate(RequestUtils.java:772)
at
org.apache.struts.action.ActionServlet.processPopulate(ActionServlet.java:20
61)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1563)
at
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:491)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:254)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:194)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:255)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja

How to display the size of an Collection attribute of a bean?

2001-04-10 Thread Thai Thanh Ha



I want to display 
the size of an Collection attribute of a Bean using Struts taglibs. I can 
use scriptlet but are there any other ways to do that? 

Regards,
Thai


Problem using struts-example.war with J2SDKEE1.3(beta)

2001-03-08 Thread Thai Thanh Ha


 I can't use struts-example.war with J2SDKEE1.3(beta). The JSP pages work
normally, but when I use *.do, server always returns:



HTTP Status 404 - /editRegistration.do
The requested resource (/editRegistration.do) is not available. 

What's wrong? Please help me! I know that J2EESDK isn't a good enviroment
for development. But I must use it :-(

 Regards,
 Thai



RE: Problem using struts-example.war with J2SDKEE1.3(beta)

2001-03-08 Thread Thai Thanh Ha


 Thank you for your help. Now I have found the reason. The deploy tool
always changes the web.xml in my WAR file( *.do  to /*.do ) so anything.do
can't be found. Maybe this is a bug of deploy tool? I found where the J2EE
server stores its JAR files and change them every time I want to change my
WAR files. ( Not a good way to deploy applications! :-) )

 Regards,
 Thai

-Original Message-
From: Jean-Nol Ribette [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 08, 2001 10:04 PM
To: [EMAIL PROTECTED]
Subject: Re: Problem using struts-example.war with J2SDKEE1.3(beta)



- Original Message -
From: Thai Thanh Ha [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, March 08, 2001 7:03 AM
Subject: Problem using struts-example.war with J2SDKEE1.3(beta)



  I can't use struts-example.war with J2SDKEE1.3(beta). The JSP pages work
 normally, but when I use *.do, server always returns:



 HTTP Status 404 - /editRegistration.do
 The requested resource (/editRegistration.do) is not available.

 What's wrong? Please help me! I know that J2EESDK isn't a good enviroment
 for development. But I must use it :-(

It looks like your server is looking for a file name /editRegistration.do
(error 404) instead of calling the action servlet.
Did you map *.do to the action servlet ? The mapping is normally done in the
web.xml file but you may need to specify the mapping in the deploytool.

  Regards,
  Thai


Jean-Noel



Problem with using logic:equal tag

2001-03-07 Thread Thai Thanh Ha


 I want to use logic:equal with a boolean attribute of a bean. But I
always received error:

--
Exception Report:
javax.servlet.ServletException: No bean found under attribute key
currentSupplier
at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp
l.java:481)
at
_0002fsuppliers_0002ejspsuppliers_jsp_0._jspService(_0002fsuppliers_0002ejsp
suppliers_jsp_0.java:272)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
   .

Root Cause:
javax.servlet.jsp.JspException: No bean found under attribute key
currentSupplier
at
org.apache.struts.taglib.template.InsertTag.doEndTag(InsertTag.java:131)
at
_0002fsuppliers_0002ejspsuppliers_jsp_0._jspService(_0002fsuppliers_0002ejsp
suppliers_jsp_0.java:258)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
  ...
-


 This is my JSP page:

logic:iterate id="currentSupplier" 
  name="ViewSuppliersAction.suppliers" scope="request"
...
  logic:equal name="currentSupplier" property="active"
 scope="request" value="true"
 input type="checkbox" name="checkbox" checked
  /logic:equal

  logic:equal name="currentSupplier" property="active"
 scope="request" value="false"
 input type="checkbox" name="checkbox"
  /logic:equal
...
/logic:iterate

-

 I don't know what's wrong. Maybe this tag can't handle boolean value? I
know that currentSupplier bean is valid (because bean:message tag can work
in the logic:iterate tag)

 Please help me!

 Regards,
 Thai



Problem in Struts example (struts-example.war)

2001-03-04 Thread Thai Thanh Ha


 Hi all,

 I have found this  code in the Struts example (file:
EditRegistrationAction.java, line: 144)

 if (form == null) {
   ...   
 }

 When EditRegistrationAction.perform() is called, form will be a reference
to a RegistrationForm (*never* be null, because the ActionForm object has
been created before by the ActionServlet object). Is it correct? Why has the
author written this code? Can anyone help me?

 Regards,
 Thai 



RE: Cannot deploy struts-blank.war onto j2eesdk1.2.1

2001-03-02 Thread Thai Thanh Ha


 Thank you for your help! Now I'm using J2eesdk1.3 beta and Struts examples
work very well :-)

 Regards,
 Thai

-Original Message-
From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
Sent: Saturday, March 03, 2001 1:30 AM
To: [EMAIL PROTECTED]
Subject: Re: Cannot deploy struts-blank.war onto j2eesdk1.2.1


Rob Leland wrote:

 I have no problem with using J2eesdk1.2.1.
 You'll need to be more specific, as to the problem you
 are encountering. It is likely a CLASSPATH problem.

 -Rob


It would also be helpful if some kind souls would try this with the
J2eesdk1.3 beta that was recently released (it includes Tomcat 4.0-beta-1
as the web layer) and report their success or problems.

Craig




Cannot deploy struts-blank.war onto j2eesdk1.2.1

2001-03-01 Thread Thai Thanh Ha



I can't deploy 
struts-blank.war (struts 1.0b1)onto j2eesdk1.2.1 . Has anyone done it 
before? Please help me!