Re: how to Internationalized submit button?

2002-07-18 Thread Tadashi Ishikawa
You can use hidden field and Javascript.


function setAction(target) {
document.forms[0].actionName.value=target;
}


$B!D(B








Hoang, Hai wrote:

>I want to internationalize the submit buttons on a form and I don't know how
>to do it.  Currently, I mapped the value on the submit button to the
>property actionName in the ActionForm class.  Base on the button the use
>clicked, I handle it propriately in the Action class, just like event
>handling mechanism.  Now if I internationalize these buttons (property="actionName"/>, the
>value will change and my Action class will no longer work.  Is there a way
>to work around this problem?
>
>To be specific, following is the detail about my setup
>
>1. jsp page:
>
>
>
>
>
>2. actionForm class:
>
>public String getActionName() 
>{
>   return actionName;
>}
>
>public void setActionName( String actionName) 
>{
>   this.actionName = actionName;
>}
>
>
>3. action class:
>
>ApplicationForm applicationForm = (ApplicationForm)form;
>String action = applicationForm.getActionName();
>if (action == null)
>{
>   action = Constants.BUTTON_CANCEL;
>}
>
>if (action.equals(Constants.BUTTON_CANCEL))
>{
>   applicationForm.setActionName(null);
>   doAdd(mapping, applicationForm, request, response);
>}
>else if (action.equals(Constants.BUTTON_ADD)) 
>{
>doAdd(mapping, applicationForm, request, response);
>}
>else if (action.equals(Constants.BUTTON_SAVE)) 
>{
>doSave(mapping, applicationForm, request, response);
>}
>else if (action.equals(Constants.BUTTON_EDIT) || 
>   action.equals(Constants.BUTTON_REMOVE)) 
>{
>doEdit(mapping, applicationForm, request, response);
>}
>else if (action.equals(Constants.BUTTON_UPDATE)) 
>{
>doUpdate(mapping, applicationForm, request, response);
>}
>else if (action.equals(Constants.BUTTON_DELETE)) 
>{
>doDelete(mapping, applicationForm, request, response);
>}
>
>Thank you for your help
>
>--
>To unsubscribe, e-mail:   
>For additional commands, e-mail: 
>
>
>
>


Re: Antwort: RE: Antwort: StrutsTestCase - setConfigFile() - LinkageError

2002-07-04 Thread Tadashi Ishikawa

I tested CactusStrutsTestCase *NOT* MockStrutsTestCase earlier.

public class TestLoginAction extends CactusStrutsTestCase {
public void setUp() throws Exception {
super.setUp();
setConfigFile("/WEB-INF/conf/struts-config.xml");
}

It worked good in WebLogic6.1 and Tomcat4.0.3.

If you're using MockStrutsTestCase, you don't need  any Web container.

You only need to set the CLASSPATH to point to the
/Programme/IBM/ApplicationDeveloper/workspace/MANTemplateWebApp/webApplication
directory along with any other needed jar files.

Hope this helps.

[EMAIL PROTECTED] wrote:

>thanks for your answer first ...
>
>I did not understand the java-doc for setConfigFile() like this.
>o.k. - the File has to be on the classpath anyway ...
>
>I put the struts-config.xml in the classes directory (which is in the
>classpath) because I can not
>set nested directories in the classpath in my ide (websphere app.
>developer).
>
>Now I print my environment from the setup() method looking for the
>classpath ... it is
>
>  java.class.path =
>
>C:\Programme\IBM\Application
>Developer\workspace\MANTemplateWebApp\webApplication\WEB-INF\classes
>C:\Programme\IBM\Application
>Developer\workspace\MANTemplateWebApp\webApplication\WEB-INF\lib\ApacheXerces_r1-4-4.jar;
>C:\Programme\IBM\Application
>Developer\plugins\com.ibm.etools.websphere.runtime\lib\j2ee.jar;
>C:\Programme\IBM\Application
>Developer\plugins\com.ibm.etools.websphere.runtime\lib\webcontainer.jar;
>C:\Programme\IBM\Application
>Developer\plugins\com.ibm.etools.websphere.runtime\lib\ivjejb35.jar;
>C:\Programme\IBM\Application
>Developer\plugins\com.ibm.etools.websphere.runtime\lib\websphere.jar;
>C:\Programme\IBM\Application
>Developer\workspace\MANTemplateWebApp\webApplication\WEB-INF\lib\JakartaCactus_r1-2_v1-0.jar;
>C:\Programme\IBM\Application
>Developer\workspace\MANTemplateWebApp\webApplication\WEB-INF\lib\JakartaStruts_r1-0-1_v1-1.jar;
>C:\Programme\IBM\Application
>Developer\workspace\MANTemplateWebApp\webApplication\WEB-INF\lib\SourceForgeJUnit_r3-7_v1-0.jar;
>C:\Programme\IBM\Application
>Developer\workspace\MANTemplateWebApp\webApplication\WEB-INF\lib\JakartaLog4J_r1-1-3.jar;
>C:\Programme\IBM\Application
>Developer\workspace\MANTemplateWebApp\webApplication\WEB-INF\lib\JavaMail_r1-1-3.jar;
>C:\Programme\IBM\Application
>Developer\workspace\MANTemplateWebApp\webApplication\WEB-INF\lib\JavaActivation_r1-0-1.jar;
>C:\Programme\IBM\Application
>Developer\workspace\MANTemplateWebApp\webApplication\WEB-INF\lib\JDom_r1-0beta8.jar;
>
>should be fine
>
>As described by Oren Gros in
>  http://marc.theaimsgroup.com/?l=struts-user&m=102570855720187&w=2
>I get an LinkageError now
>and my JUnit Swing App is crashing.
>
>###
>
>  public void setUp() throws Exception
>  {
>cat.debug("setUp() ... start");
>
>// never forget this!
>super.setUp();
>
>java.util.Iterator it = System.getProperties().keySet
>().iterator();
>
>while(it.hasNext()) {
>  String key = (String) it.next();
>  System.out.println( key + " : " + (String)
>System.getProperties().get(key));
>}
>// Missing configuration resource for path ...
>// this.setConfigFile("/Programme/IBM/Application
>Developer/workspace/MANTemplateWebApp/webApplication/WEB-INF/struts-config.xml");
>
>// java.lang.NullPointerException
>this.setConfigFile("/struts-config.xml");
>
>cat.debug("setUp() ... finished");
>  }
>
>###
>
>Any further ideas? Thanks for your time
>
>A. Grimm
>
>
>MAN Nutzfahrzeuge AG
>Anton Grimm
>Abt. IDP (SoftwareProduktionsumgebungen)
>Dachauerstr.667
>80995 München
>
>Tel.:  089/1580-1054
>Fax:  089/1580-911054
>E-Mail: [EMAIL PROTECTED]
>
>
>
>  
> 
>  "Kevin Henrikson"   
> 
>  List" <[EMAIL PROTECTED]>
>  enwave.com>Kopie:   
> 
> Thema:RE: Antwort: 
>StrutsTestCase - setConfigFile()   
>  04.07.2002 09:25
> 
>  Bitte antworten an  
> 
>  "Struts Users   
> 
>  Mailing List"

Re: Struts 1.1 on Weblogic

2002-07-03 Thread Tadashi Ishikawa

Does your WLS support web-app_2_3.dtd?

Anand Narayan wrote:

>I am getting the following error while trying to port an app from Struts 1.0
>to 1.1
>Has anyone encountered anything similar.  Thanks
>
>  
><[WebAppServletContext(7902680,sps-web-test,/sps-web-test)] Root cause of
>ServletException
>javax.servlet.jsp.JspException: Cannot find message resources under key
>org.apache.struts.action.MESSAGE
>at
>org.apache.struts.util.RequestUtils.message(RequestUtils.java:793)
>at
>org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:2
>95)
>at jsp_servlet.__sps_index_new._jspService(__sps_index_new.java:124)
>at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
>at
>weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
>pl.java:265)
>at
>weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
>pl.java:304)
>at
>weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
>pl.java:200)
>at
>weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
>rvletContext.java:2495)
>at
>weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
>pl.java:2204)
>at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
>at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
>
>
>Here's the web.xml that references the ApplicationResources
>
>
>2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd";>
>
>
>
>action
> 
>org.apache.struts.action.ActionServlet
>
>application
>egm.sps.web.ApplicationResources
>
>
>
>config
>/WEB-INF/struts-config.xml
>
>
>debug
>2
>
>
>detail
>2
>
>
>validate
>true
>
>1
>
>...
>...
>
>Its giving me the same error when I configure the application resources
>inside the struts-config.xml file as follows:
>  parameter="egm.sps.web.ApplicationResources"
>key="org.apache.struts.action.MESSAGE" />
>
>
>--
>To unsubscribe, e-mail:   
>For additional commands, e-mail: 
>
>
>
>




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Newbie pls help: Anyone using JBoss 3 w/ Struts 1.1?

2002-06-20 Thread Tadashi Ishikawa

Hi Brian,

I've tried the URL http://localhost:8080/bad/saveRegistration.do
I saw input form normaly. Your ActionForm was created, wasn't it?
When I clicked 'Save', I saw blank-page, but no exception.

As I suggested at last post, JBoss already found *Your* ActionForm 
before WebClassLoader find it.
Remove Struts-related classes from your-ejb.jar file, then it will work.

Hope this helps.

Brian Topping wrote:

>Hi James & Ishikawa-san,
>
>Oh boy, my bad.  It was late when I posted, I should have stated that the
>problem URL is http://localhost:8080/bill2site-web/editRegistration.do.  Big
>difference there!!  Ack.
>
>Could I have you try again with that URL?
>
>Thanks so much!!
>
>Brian
>
>>-Original Message-
>>From: James Mitchell [mailto:[EMAIL PROTECTED]]
>>Sent: Thursday, June 20, 2002 1:18 AM
>>To: Struts Users Mailing List
>>Subject: RE: Newbie pls help: Anyone using JBoss 3 w/ Struts 1.1?
>>
>>
>>Hi Brian,
>>
>>I posted on the jboss list about 20 minutes ago..just 
>>ignore that
>>
>>I've got JBoss 3.0 Final w/ Tomcat 4.0.3 and I get this when 
>>submitting from
>>the first page.
>>
>>
>>
>>Apache Tomcat/4.0.3 - HTTP Status 404 - /s/j_security_check
>>--
>>--
>>
>>type Status report
>>message /s/j_security_check
>>description The requested resource (/s/j_security_check) is 
>>not available.
>>
>>your index.html is submitting the login to the above url.
>>I can't seem to find that anwhere in your config files.
>>
>>
>>James Mitchell
>>Software Engineer\Struts Evangelist
>>Struts-Atlanta, the "Open Minded Developer Network"
>>http://struts-atlanta.open-tools.org
>>
>>>-Original Message-
>>>From: Brian Topping [mailto:[EMAIL PROTECTED]]
>>>Sent: Thursday, June 20, 2002 12:47 AM
>>>To: [EMAIL PROTECTED]
>>>Subject: Newbie pls help: Anyone using JBoss 3 w/ Struts 1.1?
>>>
>>>
>>>Hi All,
>>>
>>>I'm trying to get my first Struts app going.  I'm using 
>>>
>>JBoss3 with Tomcat
>>
>>>for the web container, and am having quite a bit of problems with
>>>getting my
>>>classes loaded.  It's what seems to be a common problem:
>>>"java.lang.NoClassDefFoundError:
>>>org/apache/struts/action/ActionForm".  There
>>>are a lot of solutions in the archives relating to moving 
>>>
>>jars underneath
>>
>>>WEB-INF, manifests, etc.  All I can say is that the struts.jar in
>>>this war is
>>>the only struts.jar on any classpath that I'm running under.  So
>>>if it's in
>>>the wrong location in this war (WEB-INF/lib), that may be 
>>>
>>my problem.
>>
>>>Anyone else using JBoss3+Tomcat4.0.3 release?
>>>
>>>I've got a war file at http://www.orb.org/bad.war that exhibits
>>>the problem.
>>>It works fine under Tomcat 4.0.4b3 standalone, it's simply a
>>>problem when the
>>>war is loaded under JBoss 3.  When it does the right thing, 
>>>
>>you'll get an
>>
>>>exception about not being able to locate an EJB in JNDI...
>>>
>>>I can post more information about the problem, but it seems the
>>>more I post,
>>>the harder the post is to read, so I'll start with this :)
>>>
>>>Any help appreciated, i'm so close to getting all this running!!
>>>
>>>thanks a bunch,
>>>
>>>Brian
>>>
>>>--
>>>To unsubscribe, e-mail:
>>>
>>
>>For additional commands, e-mail:
>>
>>
>>
>>
>>--
>>To unsubscribe, e-mail:   
>>
>
>For additional commands, e-mail: 
>
>
>--
>To unsubscribe, e-mail:   
>For additional commands, e-mail: 
>
>
>
>




Re: struts on weblogic 5.1.0 with SP6

2002-06-18 Thread Tadashi Ishikawa


There are three main problems I knew on WLS5.1sp6.

1. ClassLoader Problem
ApplicationResource.properties won't be found.

2. load-on-starup is ignored.

3. Classes used by JSP or Servlet must be loaded earlier.

So,You shoud follow steps described below.

(1)expand struts-example.war to directory Not in CLASSPATH.

(2)expand attached zip file?and copy WebAppStartup.class to directory 
which WLS can pick up.
(ex. /export/weblogic/classes)

(3)edit weblogic.properties to add following lines.(example)
weblogic.httpd.register.*.do=org.apache.struts.action.ActionServlet
weblogic.httpd.webApp.struts-example=/export/home/weblogic/jakarta-struts/webapps/struts-example
# WebAppStartup for Struts
weblogic.system.startupClass.myStartup=WebAppStartup
weblogic.system.startupArgs.myStartup=\
webAppContext=struts-example

Hope this helps.

Pradeep Sakre wrote:

>Thanks Daniel ,
>But is it not possible with weblogic 5.1.0 with any patch.I need to
>deploy on weblogic5.1.0 only.
>
>Regards,
>Pradeep Sakre.
>
>__
>-Original Message-
>From: Daniel Jaffa [mailto:[EMAIL PROTECTED]] 
>Sent: Monday, June 17, 2002 8:32 PM
>To: Struts Users Mailing List; [EMAIL PROTECTED]
>Subject: Re: struts on weblogic 5.1.0 with SP6
>
>
>MessageFirst off, u need to upgrade to at least sp 8 ( Though i suggest
>sp 11 or 12.  Bea has made serveral upgrades to 5.1)  Second if you can
>go to wl 6.1, Just to let u know i am using both sp 8 on one machine
>(not very happy) and sp 12 on another (Very happy, works great)
>
>  - Original Message - 
>  From: Pradeep Sakre 
>  To: Struts Users Mailing List ; [EMAIL PROTECTED] 
>  Sent: Monday, June 17, 2002 3:19 AM
>  Subject: struts on weblogic 5.1.0 with SP6
>
>
>  Hi
>
>  I am not able to deploy struts application on weblogic 5.1.0 service
>pack 6. can some one tell whether it's possible to deploy struts with
>sp6 if not what are the modifications to be done.
>
>  Thanks in advance,
>
>  Regards,
>  Pradeep Sakre.
> 
>
>__
>
>  "Success is how high you bounce when you hit bottom."
>
>  Pradeep Sakre
> 
>
>__
>
>
>
>
>
>--
>
>
>  --
>  To unsubscribe, e-mail:
>
>  For additional commands, e-mail:
>
>
>
>
>
>**Disclaimer
>
>Information contained in this E-MAIL being proprietary to Wipro Limited is 
>'privileged' and 'confidential' and intended for use only by the individual
> or entity to which it is addressed. You are notified that any use, copying 
>or dissemination of the information contained in the E-MAIL in any manner 
>whatsoever is strictly prohibited.
>
>***
>
>
>
>
>--
>To unsubscribe, e-mail:   
>For additional commands, e-mail: 
>
> Wipro_Disclaimer.txt
>
> Content-Type:
>
> text/plain
> Content-Encoding:
>
> 7bit
>
>
> 
> ??? 1.3
>
> Content-Type:
>
> text/plain
>
>




WebAppStartup.zip
Description: Zip compressed data

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


Re: i18n and struts problem

2002-03-11 Thread Tadashi Ishikawa

Are you using Tomcat? This is not Struts problem.

I changed populate() method of  RequestUtils.java in Struts-SRC. It 
works fine.

Haider Kazmi wrote:

>I will really appreciate if someone would give me a nudge in the correct direction.
>I have japanese multibyte characters in Strings that I put in my jsps with 
><%=japanString%>
>This data is corrupted when I view it in a japanese (SJIS) browser.
>
>I can fix this if instead of using japaneString I do this
>
><%=new String(japanString.getBytes("SJIS"), "ISO8859_1")%>
>
>but I don't want to do this everywhere, is there a struts tag that will do the 
>conversion for me based on the charset I have specified with 
> 
>response.setContentType() 
>
>Please help!
>
>regards
>Haider Kazmi
>




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Displaying an array of Strings

2002-02-26 Thread Tadashi Ishikawa
I give you my sample code.

<%
String [] fileNames = FileFolder.list(path);
pageContext.setAttribute("Files", fileNames, PageContext.PAGE_SCOPE);
%>







LLoyd Dobbler wrote:

>> If that's not good use iterate.
>
>
> I *want* to use the iterate tag, as I mentioned in my original post.
> But I don't know how to do it without using a bean.
>
> _
> Get your FREE download of MSN Explorer at
> http://explorer.msn.com/intl.asp.
>
>
> -- 
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
>
>
>
>




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


Re: FOP and strus (IE problem)

2002-02-19 Thread Tadashi Ishikawa

I had the same problem.(Not IE problem)

FOPServlet works fine under Tomcat3.2.3 and OC4J(Orion).
IE has a URL problem. but this is not the case.

FO -> FOP -> PDF works fine under WebLogic6.1sp1 as well.
XML + XSL ->Xalan ->FO -> FOP ->PDF won't work.

PDF file size was 0 in NN also.
I thought Xalan failed. I noticed FO wasn't created. but I got no exception.
I changed server's CLASSPATH. but nothing was changed.
I think this problem is specific to weblogic. and I couldn't solve it.

John Ng wrote:

>I still couldn't get it working in IE.  I use weblogic
>as the webserver... Do I have to do anything specific
>to weblogic?
>
>Thanks
>John
>
>--- Arron Bates <[EMAIL PROTECTED]> wrote:
>
>>Oh, what a world of pain.
>>IE in this regard is a pile of *@!# and NS is the
>>absolute honey  :)
>>
>>This is off-struts, but I know the pain you go
>>through to get IE going 
>>properly.
>>
>>Here's what I had to do to get it running
>>reliably...
>>
>>
>>// START CODE --==>>
>>
>>// set the response type
>>response.setContentType("application/pdf");
>>// set the content details
>>response.setHeader("Content-Disposition", "inline; 
>>filename=ConfirmationLetter.pdf; ");
>>
>>// creating a temporary output stream
>>ByteArrayOutputStream bout = new
>>ByteArrayOutputStream();
>>
>>// this class takes teh xml document and runs it
>>through the FOP process
>>// and pumps it into the output stream created.
>>OnlineSalesPDFGenerator pdf = new
>>OnlineSalesPDFGenerator(xmlDoc);
>>pdf.run(form,request,bout);
>>
>>byte[] content = bout.toByteArray();
>>
>>// set the exact content length from our temp output
>>stream
>>response.setContentLength(content.length);
>>
>>// write the content
>>response.getOutputStream().write(content);
>>
>>// flush the stream
>>response.getOutputStream().flush();
>>
>>// <<==-- END CODE
>>
>>
>>I went through a lot of pain to get all the
>>alternatives people were 
>>doing to get this. Important parts are...
>>a) The response type.
>>b) The Content-Disposition details. This sets
>>filenames and stuff for 
>>the file saving dialog boxes etc.
>>c) Setting the exact content length. Made possible
>>by writing to the 
>>ByteArrayOutputStream and getting its resulting
>>size.
>>
>>And if you're pessimistic (most likely you are by
>>now :), make sure you 
>>flush and close the output stream, and you can also
>>throw in what Gregor 
>>says below with your URL. After the above though,
>>you shouldn't have any 
>>problems.
>>
>>Hopefully this will get you where you need to be.
>>
>>
>>Arron.
>>
>>
>>Gregor Rayman wrote:
>>
>>>"John Ng" <[EMAIL PROTECTED]> wrote:
>>>
Hi, The following is a piece of the code that I

>>write
>>
in the perform method of an ActionForm to generate

>>the
>>
PDF.  However, it works fine in netscape, but NOT

>>IE. 
>>
Can someone help me with this?

Thanks!
John 

>>>Try adding "?.pdf" to the url.
>>>
>>>--
>>>gR
>>>
>>>
>>>--
>>>To unsubscribe, e-mail:  
>>>
>>
>>
>>>For additional commands, e-mail:
>>>
>>
>>
>>>
>>
>>
>>
>
>
>__
>Do You Yahoo!?
>Yahoo! Sports - Coverage of the 2002 Olympic Games
>http://sports.yahoo.com
>
>--
>To unsubscribe, e-mail:   
>For additional commands, e-mail: 
>
>
>
>




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Using BeanUtils.populate()

2001-12-16 Thread Tadashi Ishikawa

I think you need commons-collections.jar.

[EMAIL PROTECTED] wrote:

>Hi, I looked at Ted Husted's example (Ted's catalogue) for using
>BeanUtils.populate() to populate beans from a database query, and put them
>into an ArrayList.
>I am working on some code which queries an LDAP Directory and requires the
>same kind of functionality. I reworked Ted's example to fit my needs, but
>the beans never seem to get populated, so I end up with a ArrayList of empty
>beans! I am using the package org.apache.commons.beanutils to do this and I
>have tried version 1.0 and 1.1.
>The relevant part of the code is shown below. I may have missed something
>obvious, but I cannot see it! I have already verified that I am getting data
>from the LDAP query, and I am believe the problem lies in popuating the
>bean.
>
>Thanks in advance
>
>Neil
>
>*
>
>
> // start looping over the LDAP entries...
>  while ( searchResults.hasMoreElements())
>  {
>LDAPEntry nextEntry = null;
>try
>{
>  nextEntry = searchResults.next();
>}
>catch(LDAPException e)
>{
>  System.out.println("Error: " + e.toString());
>
>  // Exception is thrown, go for next entry
>  continue;
>}
>
>// create a HashMap to hold att/val pairs...
>HashMap properties = new HashMap();
>
>LDAPAttributeSet attributeSet = nextEntry.getAttributeSet();
>Enumeration allAttributes = attributeSet.getAttributes();
>
>// loop over each attribute..
>while(allAttributes.hasMoreElements())
>{
>  LDAPAttribute attrib = (LDAPAttribute)allAttributes.nextElement();
>
>  // get the current attribute name...
>  String attributeName = attrib.getName();
>
>  // get the value(s) for this attribute...
>  String[] Values = attrib.getStringValueArray();
>
>
>  // if we have at least 1 value for this attribute...
>  if( allValues.length != 0)
>  {
>properties.put(attributeName, Values);
>  }
>}
>
>// now populate bean for this entry...
>try
>{
>  //instantiate new bean to hold results...
>  UserResult userresult = new UserResult();
>
>  BeanUtils.populate(userresult,properties);
>  list.add(userresult);
>
>}
>catch (Exception e)
>{
>  throw new IllegalAccessException("RequestUtils.getCollection: " +
>e.toString());
>}
>  }
>
>***rest of code follows...
>
>
>
>--
>To unsubscribe, e-mail:   
>For additional commands, e-mail: 
>
>
>




--
To unsubscribe, e-mail:   
For additional commands, e-mail: