Two Data Base Connections in struts-config.xml ?

2005-01-16 Thread Jay Chandran
Hi,

Is it possible to connect to two databases from a struts application.
ie basically is it possible two add two database connectivity in
struts-config.xml?

Regards,

Jay



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



Re: help : paging in struts view

2005-01-14 Thread Jay Chandran
Hi all,

How can we read XML files using struts? is this possible. Can any one povide
a link or give an example for reading XML files using struts?

:-)


Jay



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



Using XML in struts

2005-01-14 Thread Jay Chandran
Hi all,

How can i read XML files using struts? is this possible? Can any one provide
a link or give an example for reading XML files using struts?

:-)


Jay






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



Regarding JBOSS

2005-01-13 Thread Jay Chandran
Hi all,

 I need to download JBOSS 4.0.1 for windows. Where can i get this ? What
should i download? I can see lots of  downloads for jboss. ie jboss4.0.1
RC1.zip, jboss4.0.1 RC2.zip..  etc.


Which one should i download??


:-)


Jay






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



Re: Regarding JBOSS

2005-01-13 Thread Jay Chandran
Thanks :-)

Jay


- Original Message - 
From: Slattery, Tim - BLS [EMAIL PROTECTED]
To: 'Struts Users Mailing List' user@struts.apache.org
Sent: Thursday, January 13, 2005 9:21 PM
Subject: RE: Regarding JBOSS


   I need to download JBOSS 4.0.1 for windows. Where can i get 
  this ? What should i download? I can see lots of  downloads 
  for jboss. ie jboss4.0.1 RC1.zip, jboss4.0.1 RC2.zip..  etc.
 
 http://www.jboss.org/downloads/index
 
 JBoss Application Server
 
 
 --
 Tim Slattery
 [EMAIL PROTECTED]
 
 
 -
 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: Regarding JBOSS

2005-01-13 Thread Jay Chandran
Hi,


i am downloading JBOSS from  the below link as per ur instructions.

http://ovh.dl.sourceforge.net/sourceforge/jboss/jboss-4.0.1RC1.zip

is this ok for me .

or should i download some other links. I can see lots of links for
downloading JBOSS.


jay



- Original Message - 
From: Slattery, Tim - BLS [EMAIL PROTECTED]
To: 'Struts Users Mailing List' user@struts.apache.org
Sent: Thursday, January 13, 2005 9:21 PM
Subject: RE: Regarding JBOSS


   I need to download JBOSS 4.0.1 for windows. Where can i get
  this ? What should i download? I can see lots of  downloads
  for jboss. ie jboss4.0.1 RC1.zip, jboss4.0.1 RC2.zip..  etc.

 http://www.jboss.org/downloads/index

 JBoss Application Server


 --
 Tim Slattery
 [EMAIL PROTECTED]


 -
 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: struts and Tomcat4.0.4

2004-12-30 Thread Jay Chandran
Hi,

What is ur systems configuration ? Does it have enough free space ? What
about swap space ? How much swap have you allocated at the
time of installing OS ? Do delete the files in temporary directory and also
clean up the log files.

This may help.

Regards,

jAY.



- Original Message -
From: Nadia Kunkov [EMAIL PROTECTED]
To: Struts Users Mailing List user@struts.apache.org; Jay Chandran
[EMAIL PROTECTED]
Sent: Thursday, December 30, 2004 7:33 PM
Subject: RE: struts and Tomcat4.0.4


Thanks,
Connections were a part of my problem actually.  But that got fixed and now
the system hangs after I make changes to JSPs multiple times.
Any ideas why is that?
Thanks for your help.
NK

-Original Message-
From: Jay Chandran [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 29, 2004 11:31 PM
To: Struts Users Mailing List
Subject: Re: struts and Tomcat4.0.4


if the problem is after executing the sql statement then u might not closed
the connection properly. its always good to close the resultset, statement
and connection. If ur action file does not close the sql connection the
system hangs.


- Original Message -
From: Nadia Kunkov [EMAIL PROTECTED]
To: Struts help (E-mail) user@struts.apache.org
Sent: Wednesday, December 29, 2004 9:12 PM
Subject: struts and Tomcat4.0.4


Hi,
I'm running tomcat4.0.4 on a Fedora core 1 box.
I'm bulding an application with struts and I came across a problem.
Every time my app has a problem like not finding the proper forward or
problem with a sql statment my app hangs.
When I fix the problem and go to restart the Tomcat it doesn't shutdown
properly.
I use tomcat4 stop and instead of usual:
stopping service Tomcat-Standalone
stopping service Tomcat-Apache

I only get:
stopping service Tomcat-Standalone
After that tomcat can't be restarted since it's not shutdown properly and I
have to restart my machine, which is rediculous.
What is the way to force tomcat to shutdown?
Why is Struts affecting tomcat this way?  I didn't have problems with
Tomcat4 before I started working with struts.
Any ideas?
Thanks
NK

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


-
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: struts and Tomcat4.0.4

2004-12-29 Thread Jay Chandran
if the problem is after executing the sql statement then u might not closed
the connection properly. its always good to close the resultset, statement
and connection. If ur action file does not close the sql connection the
system hangs.


- Original Message -
From: Nadia Kunkov [EMAIL PROTECTED]
To: Struts help (E-mail) user@struts.apache.org
Sent: Wednesday, December 29, 2004 9:12 PM
Subject: struts and Tomcat4.0.4


Hi,
I'm running tomcat4.0.4 on a Fedora core 1 box.
I'm bulding an application with struts and I came across a problem.
Every time my app has a problem like not finding the proper forward or
problem with a sql statment my app hangs.
When I fix the problem and go to restart the Tomcat it doesn't shutdown
properly.
I use tomcat4 stop and instead of usual:
stopping service Tomcat-Standalone
stopping service Tomcat-Apache

I only get:
stopping service Tomcat-Standalone
After that tomcat can't be restarted since it's not shutdown properly and I
have to restart my machine, which is rediculous.
What is the way to force tomcat to shutdown?
Why is Struts affecting tomcat this way?  I didn't have problems with
Tomcat4 before I started working with struts.
Any ideas?
Thanks
NK

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



Displaying applets

2004-12-22 Thread Jay Chandran
Is it possible to display the output as an applet in struts? if so how is it
possible ?

Thanks ,

Jay



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



Re: Displaying applets

2004-12-22 Thread Jay Chandran
Thanks Ram and jack .. :-)

- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, December 22, 2004 3:13 PM
Subject: RE: Displaying applets


Hi Jay,

You can have an applet client, which talks to struts on the server side
and displays the values. In this case, your client GUI should be applet
and from the applet, you can communicate with struts action class. Use
DTO's as data carriers between the client and Servlets. Try searching
for applet servlet communication articles. This should throw some light.

HTH


Thanks and Regards,
S.Ramkumar



-Original Message-
From: Dakota Jack [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 22, 2004 2:57 PM
To: Struts Users Mailing List; Jay Chandran
Subject: Re: Displaying applets

Struts is really fairly Applets agnostic, Jay.  You don't have to make
any connection with Struts to do Applets.  I don't know if there is
some special code out there tangential to Struts but connected, like
Struts file upload.

Jack


On Wed, 22 Dec 2004 14:05:49 +0530, Jay Chandran
[EMAIL PROTECTED] wrote:
 Is it possible to display the output as an applet in struts? if so how
is it
 possible ?

 Thanks ,

 Jay

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




--
You can lead a horse to water but you cannot make it float on its
back.

~Dakota Jack~

You can't wake a person who is pretending to be asleep.

~Native Proverb~

Each man is good in His sight. It is not necessary for eagles to be
crows.

~Hunkesni (Sitting Bull), Hunkpapa Sioux~

---

This message may contain confidential and/or privileged information.
If you are not the addressee or authorized to receive this for the
addressee, you must not use, copy, disclose, or take any action based
on this message or any information herein. If you have received this
message in error, please advise the sender immediately by reply e-mail
and delete this message. Thank you for your cooperation.

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



DISCLAIMER:
This message contains privileged and confidential information and is
intended only for the individual named.If you are not the intended recipient
you should not disseminate,distribute,store,print, copy or deliver this
message.Please notify the sender immediately by e-mail if you have received
this e-mail by mistake and delete this e-mail from your system.E-mail
transmission cannot be guaranteed to be secure or error-free as information
could be intercepted,corrupted,lost,destroyed,arrive late or incomplete or
contain viruses.The sender therefore does not accept liability for any
errors or omissions in the contents of this message which arise as a result
of e-mail transmission. If verification is required please request a
hard-copy version.

-
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: How to implement torque?

2004-12-21 Thread Jay Chandran
Thanks Eddie

I will do that. Have u tried implementing the same? :)

Jay Chandran.


- Original Message -
From: Eddie Bush [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]; Jay Chandran
[EMAIL PROTECTED]
Sent: Wednesday, December 22, 2004 11:32 AM
Subject: Re: How to implement torque?


 Have you tried surfing the Torque site for docs?  They used to have
 some decent docs ... been ages since I looked at it though.

 I believe they have a user list there - for Turbine, if not Torque.
 That is likely a better spot to ask than here.

 On Wed, 22 Dec 2004 11:32:26 +0530, Jay Chandran
 [EMAIL PROTECTED] wrote:
  Does any one knows how to implement TORQUE in an existing system
implemented
  using struts and postgreSQL.
 
  :(
 
  Jay Chandran

 --
 Eddie Bush





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



Re: file upload problem

2004-12-18 Thread Jay Chandran
include the below and check

html:text property=filePath value=/upload/images
enctype=multipart/form-data/


  - Original Message -
From: uma.k [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Saturday, December 18, 2004 3:10 PM
Subject: file upload problem


 Hi,
 I am modifying the upload files given by struts and trying to upload the
 file to server without the user entering any path.

 I have modified the upload.jsp with
 html:text property=filePath value=/upload/images /

 Its means I am trying to upload to the same context in which the jsp is
 running (webapps/test/upload/images)

 I have modified the UploadAction.java as

 //else {
 //write the file to the file specified
 String filePath = theForm.getFilePath();
 System.out.println(filePath:+filePath);
 String fileName2 = filePath+/+fileName;
 System.out.println(fileName2:+fileName2);
 OutputStream bos = new FileOutputStream(fileName2);
 int bytesRead = 0;
 byte[] buffer = new byte[8192];
 while ((bytesRead = stream.read(buffer, 0, 8192))
!= -1)
 {
 bos.write(buffer, 0, bytesRead);
 }
 bos.close();
 data = The file has been written to \ +
 theForm.getFilePath() + \;
 //}

 I get this output too
 filePath:/upload/images
 fileName2:/upload/images/test.jpg

 I do not have any error the page just becomes blank and the file is not
 uploaded. Any ideas?

 Uma


 -
 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: Preview of an Image and text

2004-12-18 Thread Jay Chandran
1. From the jsp page select the image (image path) for uploading. Let the
preview button be a submit button .

form name =frm method=POST action=$link.setAction('graphics')
enctype=multipart/form-data
INPUT TYPE =hidden NAME =filePath size=39 value=C:\Program
Files\Tomcat 5.0\webapps\cevm\uploadedimages\/
input type=submit value=Preview  style=width:80
onClick=setHidValue() 

function setHidValue()
{
  document.frm.paramPassed.value=preview;
}

 input type=hidden name=paramPassed size=25/

ie when u click the preview button a java script function is called, in
which we assign a value to the hidden variable as preview. this value is
passed to the action file.

ur struts config file willl be

form-bean  name=graphicsForm type=GraphicsForm/

action  path=/graphics
   type=GraphicsInfoDetailsAction
   name=graphicsForm
   scope=request
   input=/submit.vm
   forward name=preview path=/preview.vm /
 /action

ur graphicsForm is

import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.upload.FormFile;
import org.apache.struts.upload.MultipartRequestHandler;



public class GraphicsForm extends ActionForm
{

public static final String ERROR_PROPERTY_MAX_LENGTH_EXCEEDED =
MaxLengthExceeded;


/**
 * The value of the text the user has sent as form data
 */
protected String theText;

/**
 * The value of the embedded query string parameter
 */
protected String queryParam;

/**
 * Whether or not to write to a file
 */
protected boolean writeFile;

/**
 * The file that the user has uploaded
 */

 protected FormFile logoFile;





/**
 * The file path to write to
 */
protected String filePath;


/**
 * Retrieve the value of the text the user has sent as form data
 */

protected String paramPassed;



 public String getParamPassed() {
 return paramPassed;
 }

 public void setParamPassed(String argParamPassed) {
 this.paramPassed=argParamPassed;
 }


/**
 * Retrieve the value of the query string parameter
 */
public String getQueryParam() {
 // queryParam=Successful;
return queryParam;
}

/**
 * Set the value of the query string parameter
 */
public void setQueryParam(String queryParam) {
this.queryParam = queryParam;
}

/**
 * Retrieve a representation of the logoFile the user has uploaded
 */
public FormFile getLogoFile() {
return logoFile;
}


/**
 * Set a representation of the logoFile the user has uploaded
 */
public void setLogoFile(FormFile logoFile) {
this.logoFile = logoFile;
}

/**
 * Set whether or not to write to a file
 */
public void setWriteFile(boolean writeFile) {
this.writeFile = writeFile;
}

/**
 * Get whether or not to write to a file
 */
public boolean getWriteFile() {
return writeFile;
}

/**
 * Set the path to write a file to
 */
public void setFilePath(String filePath) {
this.filePath = filePath;
}

/**
 * Get the path to write a file to
 */
public String getFilePath() {
return filePath;
}

public void reset() {
writeFile = false;
}

/**
 * Check to make sure the client hasn't exceeded the maximum allowed
upload size inside of this
 * validate method.
 */
public ActionErrors validate(ActionMapping mapping, HttpServletRequest
request)
{
ActionErrors errors = null;
//has the maximum length been exceeded?
Boolean maxLengthExceeded = (Boolean)

request.getAttribute(MultipartRequestHandler.ATTRIBUTE_MAX_LENGTH_EXCEEDED);
if ((maxLengthExceeded != null) 
(maxLengthExceeded.booleanValue()))
{
errors = new ActionErrors();
errors.add(ERROR_PROPERTY_MAX_LENGTH_EXCEEDED, new
ActionError(maxLengthExceeded));
}


return errors;

}
}


ur action file will be

import java.io.ByteArrayOutputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

import java.util.Date;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.text.SimpleDateFormat;

import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.upload.FormFile;
import org.apache.struts.action.ActionServlet;


import java.sql.Connection;

Re: file upload problem

2004-12-18 Thread Jay Chandran
change the below line  of ur action file
String fileName2 = filePath+/+fileName;
to
String fileName2 = filePath+fileName;


- Original Message -
From: uma.k [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]; 'Jay Chandran'
[EMAIL PROTECTED]
Sent: Saturday, December 18, 2004 3:44 PM
Subject: RE: file upload problem


 I get an error
 org.apache.jasper.compiler.CompileException: /upload/upload.jsp(32,4)
 Attribute enctype invalid according to the specified TLD

 I am already using  enctype in the html:form But when I hard code the
 value to system path e.g. c:\\test\\mages then it works but I dont want
 this. As I need to upload the file to the server.

 Any ideas?

 -Original Message-
 From: Jay Chandran [mailto:[EMAIL PROTECTED]
 Sent: Saturday, December 18, 2004 3:57 PM
 To: Struts Users Mailing List
 Subject: Re: file upload problem


 include the below and check

 html:text property=filePath value=/upload/images
 enctype=multipart/form-data/


   - Original Message -
 From: uma.k [EMAIL PROTECTED]
 To: 'Struts Users Mailing List' [EMAIL PROTECTED]
 Sent: Saturday, December 18, 2004 3:10 PM
 Subject: file upload problem


  Hi,
  I am modifying the upload files given by struts and trying to upload the
  file to server without the user entering any path.
 
  I have modified the upload.jsp with
  html:text property=filePath value=/upload/images /
 
  Its means I am trying to upload to the same context in which the jsp is
  running (webapps/test/upload/images)
 
  I have modified the UploadAction.java as
 
  //else {
  //write the file to the file specified
  String filePath = theForm.getFilePath();
  System.out.println(filePath:+filePath);
  String fileName2 = filePath+/+fileName;
  System.out.println(fileName2:+fileName2);
  OutputStream bos = new FileOutputStream(fileName2);
  int bytesRead = 0;
  byte[] buffer = new byte[8192];
  while ((bytesRead = stream.read(buffer, 0, 8192))
 != -1)
  {
  bos.write(buffer, 0, bytesRead);
  }
  bos.close();
  data = The file has been written to \ +
  theForm.getFilePath() + \;
  //}
 
  I get this output too
  filePath:/upload/images
  fileName2:/upload/images/test.jpg
 
  I do not have any error the page just becomes blank and the file is not
  uploaded. Any ideas?
 
  Uma
 
 
  -
  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]


 -
 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: file upload problem

2004-12-18 Thread Jay Chandran
how is ur file path given ??/

 please try to give the full path ie like C:\Program Files\Tomcat
5.0\webapps\cevm\uploadedimages\

ie filePath value should be C:\Program Files\Tomcat
5.0\webapps\cevm\uploadedimages\

ie in your jsp page give something as below .

INPUT TYPE =hidden NAME =filePath size=39 value=C:\Program
Files\Tomcat 5.0\webapps\cevm\uploadedimages\/

- Original Message -
From: uma.k [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]; 'Jay Chandran'
[EMAIL PROTECTED]
Sent: Sunday, December 19, 2004 12:32 PM
Subject: RE: file upload problem


 Hi Jay,
 I tried this way too, but I am actually getting FileNotFoundException.
This
 is the modified code
 String filePath = theForm.getFilePath();
 System.out.println(filePath:+filePath);
 String fileName2 = filePath+fileName;
 System.out.println(fileName2:+fileName2);
 //byte[] fileContent =file.getFileData();
 OutputStream bos = new FileOutputStream(new File(fileName2));
 int bytesRead = 0;
 byte[] buffer = new byte[8192];
 while ((bytesRead = stream.read(buffer, 0, 8192)) != -1) {
   bos.write(buffer, 0, bytesRead);
 }
 bos.close();

 In the catch block I made SOP to print the exception and this is the
output
 in Tomcat console.

 filePath:/upload/images/
 fileName2:/upload/images/test.jpg
 fnfejava.io.FileNotFoundException: \upload\images\test.jpg (The system
 cannot
 find the path specified)

 Why is the system not able to find out the path?

 Uma


 -
 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: [SOLVED] RE: NullPointerException

2004-12-17 Thread Jay Chandran
uma ,
Good Work..
its always better to take a backup of the working directory . hope u know it
well . still reminding ..


- Original Message -
From: uma.k [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Friday, December 17, 2004 11:52 AM
Subject: [SOLVED] RE: NullPointerException


 Thanks all for your replies. I created another context and copied all of
my
 files from the existing context to the new context and its working fine.
But
 I still do not understand why it didn't work in the existing context.

 Uma

 -Original Message-
 From: Hubert Rabago [mailto:[EMAIL PROTECTED]
 Sent: Thursday, December 16, 2004 9:43 PM
 To: Struts Users Mailing List
 Subject: Re: NullPointerException


 Struts does not support multiple mappings.  See the first warning at
 the bottom of
 http://struts.apache.org/userGuide/configuration.html#dd_config_mapping

 Hubert

 On Thu, 16 Dec 2004 21:18:18 +0530, uma.k [EMAIL PROTECTED] wrote:
  It doesn't make any difference as the same works in another context.
 
  -Original Message-
  From: news [mailto:[EMAIL PROTECTED] Behalf Of Bill Siggelkow
  Sent: Thursday, December 16, 2004 9:12 PM
  To: [EMAIL PROTECTED]
  Subject: Re: NullPointerException
 
  Hmm -- I do see that you have two servlet mappings for the
  ActionServlet. You should only have one of these.
 
  uma.k wrote:
 
   This is my web.xml file
  
   ?xml version=1.0 encoding=ISO-8859-1?
  
   !DOCTYPE web-app
   PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.2//EN
   http://java.sun.com/j2ee/dtds/web-app_2_2.dtd;
  
   web-app
  
 !-- Standard Action Servlet Configuration (with debugging) --
 servlet
   servlet-nameaction/servlet-name
  
 servlet-classorg.apache.struts.action.ActionServlet/servlet-class
   init-param
 param-nameconfig/param-name
 param-value/WEB-INF/struts-config.xml/param-value
   /init-param
   init-param
 param-namedebug/param-name
 param-value2/param-value
   /init-param
   init-param
 param-namedetail/param-name
 param-value2/param-value
   /init-param
   load-on-startup2/load-on-startup
 /servlet
  
 !-- Standard Action Servlet Mapping --
 !-- if you use this then you need to give /do/somename in path --
 servlet-mapping
   servlet-nameaction/servlet-name
   url-pattern/do/*/url-pattern
 /servlet-mapping
  
 !-- if you use this then you need to give /somename.do in path --
 servlet-mapping
   servlet-nameaction/servlet-name
   url-pattern*.do/url-pattern
 /servlet-mapping
  
 !-- The Usual Welcome File List --
 welcome-file-list
   welcome-fileindex.jsp/welcome-file
 /welcome-file-list
  
  
 !-- Struts Tag Library Descriptors --
 taglib
   taglib-uri/WEB-INF/struts-bean/taglib-uri
   taglib-location/WEB-INF/struts-bean.tld/taglib-location
 /taglib
  
 taglib
   taglib-uri/WEB-INF/struts-html/taglib-uri
   taglib-location/WEB-INF/struts-html.tld/taglib-location
 /taglib
  
 taglib
   taglib-uri/WEB-INF/struts-logic/taglib-uri
   taglib-location/WEB-INF/struts-logic.tld/taglib-location
 /taglib
  
 taglib
   taglib-uri/WEB-INF/struts-nested/taglib-uri
   taglib-location/WEB-INF/struts-nested.tld/taglib-location
 /taglib
  
 taglib
   taglib-uri/WEB-INF/struts-tiles/taglib-uri
   taglib-location/WEB-INF/struts-tiles.tld/taglib-location
 /taglib
  
 taglib
   taglib-urijstl/c/taglib-uri
   taglib-location/WEB-INF/c.tld/taglib-location
 /taglib
  
  
   /web-app
  
  
  
   -Original Message-
   From: news [mailto:[EMAIL PROTECTED] Behalf Of Bill Siggelkow
   Sent: Thursday, December 16, 2004 8:34 PM
   To: [EMAIL PROTECTED]
   Subject: Re: NullPointerException
  
  
  
   Wierd -- it looks to me from the original message that you are getting
   the error on line 1219 of TagUtils which is:
  
resources =
(MessageResources) pageContext.getAttribute(
bundle + moduleConfig.getPrefix(),
PageContext.APPLICATION_SCOPE);
  
   This would seem to indicate that your 'moduleConfig' would be null.
   What does your web.xml look like?
  
   uma.k wrote:
  
  
  If you look at the error message, I get NullPointer at this line in
the
  generated java file
  
  int _jspx_eval_bean_message_0 = _jspx_th_bean_message_0.doStartTag();
  //NULLPOINTER
  
  package org.apache.jsp;
  
  import javax.servlet.*;
  import javax.servlet.http.*;
  import javax.servlet.jsp.*;
  import org.apache.jasper.runtime.*;
  
  
  public class index$jsp extends HttpJspBase {
  
  
  static {
  }
  public index$jsp( ) {
  }
  
  private static boolean _jspx_inited = false;
  
  public final void _jspx_init() throws
  org.apache.jasper.runtime.JspException {
  }
  
  public 

Re: NullPointerException

2004-12-16 Thread Jay Chandran
i am not a fundu in struts  but still ..:)

please go through the below link and check whether it make sense. Null
pointer exception usually arises when we are trying to extract some values
from variables which are null. Please check whether the variables u r
calling when the action is performed  html:link page=/articleForm.doAdd
An Article/html:link is taking null values. make sure that variables are
not null.

http://www.junlu.com/msg/127812.html


- Original Message -
From: uma.k [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Thursday, December 16, 2004 6:16 PM
Subject: NullPointerException


 I get NullPointerException when I access this index.jsp page. I also have
 ApplicationResources.properties file in web-inf/classes folder

 %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean %
 %@ taglib uri=/WEB-INF/struts-html.tld prefix=html %
 html
 head
 titlebean:message key=title.employeeApp//title
 /head
 body
 h1bean:message key=title.employeeApp//h1
 br
 html:link page=/articleForm.doAdd An Article/html:link
 /body
 /html

 This is my struts-config.xml file

 ?xml version=1.0 encoding=ISO-8859-1 ?

 !DOCTYPE struts-config PUBLIC
   -//Apache Software Foundation//DTD Struts Configuration
1.2//EN
   http://jakarta.apache.org/struts/dtds/struts-config_1_2.dtd;


 struts-config

 form-beans
 form-bean name=articleForm type=articles.ArticleForm/
 /form-beans

 action-mappings

 action path=/articleForm
 forward=/articles/Template.jsp /

 action
 path=/InsertArticle
 type=articles.ArticleAction
 name=articleForm
 scope=request
 validate=false
 input=/Template.jsp
 forward name=success path=/articles/preview.jsp/
 forward name=failure path=/articles/Template.jsp/
 /action

 /action-mappings

 message-resources
 parameter=ApplicationResources
 null=false /


 /struts-config


 This is my complete exception

 java.lang.NullPointerException
 at

org.apache.struts.taglib.TagUtils.retrieveMessageResources(TagUtils.java:121
 9)
 at org.apache.struts.taglib.TagUtils.message(TagUtils.java:1082)
 at
org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:226)
 at org.apache.jsp.index$jsp._jspService(index$jsp.java:68)
 at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
 at

org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
 va:201)
 at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
 at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
 at

org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
 FilterChain.java:247)
 at

org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
 ain.java:193)
 at

org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
 va:243)
 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:190)
 at

org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
 66)
 at

org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:2
 46)
 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.StandardContext.invoke(StandardContext.java:2347)
 at

org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180
 )
 at

org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
 66)
 at

org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
 java:170)
 at

org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
 64)
 at

org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170
 )
 at

org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
 64)
 at
 org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
 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
 :174)
 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


Re: can i get solved example

2004-11-16 Thread Jay Chandran
Hi,
 You can go through Professional jakarta Struts 1.1 written by james
goodwill and  richard hightower. its published by wrox .

jay

- Original Message -
From: Nishant [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Tuesday, November 16, 2004 4:40 PM
Subject: can i get solved example


hi, can i get anywere solved struts examples because it will made easy to
understand struts 
Nishant Patil
Software Engineer
Cybage Software Pvt. Ltd. (A CMM Level 3 Company)
West Avenue , Kalyani Nagar,
Pune - 411 006
Tel: 91-20-4041700  -355
Email: [EMAIL PROTECTED]
Website: www.cybage.com
There's a difference between knowing the path, and walking the path



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



Re: ActionMapping without a formbean

2004-10-27 Thread Jay Chandran
I am not a big struts giant :)

But let me give my suggestions on ur doubt


 In the case of links we are just invoking a java (acion) file . If we need
to send some value through links to action file we need to send as parameter
from our link.

  HTML:FORM tag is mainly meant for passing form values from a jsp,vm page
to the action.

I think, If you can send parameters from ur form tag, we can do this
without form bean.

Please try it out :)




- Original Message -
From: Håkan Fransson [EMAIL PROTECTED]
To: Struts User Llist (E-mail) [EMAIL PROTECTED]
Sent: Wednesday, October 27, 2004 2:46 PM
Subject: ActionMapping without a formbean


 Hi!
 I know that this is and old issue but i'm not satisfied with solutions.
 We have used links with images to go to actions without forms and it works
 fine.
 Now we got demands that we must use html buttons on pages for
accessability.
 I've seen
 two workarounds, use a dummy form or regular html form tag. But it's not
so
 nice with
 dummy forms and an absolut path to the action on the jsp page.
 Is there any other solution i can use and why doesn't html:form tag
support
 mappings without
 formbeans.

 *
 Håkan Fransson
 System developer
 Ladok, Umea University
 SE-901 87 Umea, Sweden
 Phone: +46 (0)90 786 6938
 Email: [EMAIL PROTECTED]
 *



 -
 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: Validation

2004-10-18 Thread Jay Chandran
Hello Ankur,
I think u are getting the error page only because u did not define the
output page. ie in action tag we should specify an output page (.jsp etc)


Please check the below code .

  form-bean name=logonForm
   type=org.apache.struts.validator.DynaValidatorForm
  form-property name=username type=java.lang.String/
  form-property name=password type=java.lang.String/
 /form-bean

actionpath=/logon
type=com.bagnet.nettracer.tracing.actions.LogonAction
name=logonForm
scope=request
validate=true
input=/index.jsp
forward name=success path=/output.jsp/
/action

Hope it helps u .

Regards :)


Krishna

- Original Message -
From: Ankur Gupta [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Monday, October 18, 2004 11:47 PM
Subject: Validation


 Hello,


 I have setup validation logic on a form, however, when I click on submit a
 blank page is displayed. Following is my configuration:


 form-beans

 form-bean name=logonForm
 type=org.apache.struts.validator.DynaValidatorForm
 form-property name=username type=java.lang.String/
   form-property name=password type=java.lang.String/
   /form-bean




 actionpath=/logon
 type=com.bagnet.nettracer.tracing.actions.LogonAction
 name=logonForm
 scope=request
 validate=true
 input=/index.jsp
 /action


 What can I be doing wrong??

 -ankur


 -
 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: how to send batch emails

2004-10-13 Thread Jay Chandran
Hai ,

Please check the below code which helps u to send batch mails ..

import javax.mail.Folder;
import javax.mail.Store;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.Session;
import java.util.Properties;
import java.sql.Connection;
import javax.sql.DataSource;
import java.sql.ResultSet;
import java.sql.Statement;
import java.sql.SQLException;
import java.util.Date;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.lang.String;
import java.text.SimpleDateFormat;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.ActionServlet;
import org.apache.struts.action.DynaActionForm;
import java.util.ArrayList;




public final class PricingInfoAction extends Action
 {

   private static final String SMTP_HOST_NAME = ;

   public String emailMsgTxt = null;
   private static final String emailSubjectTxt  = Ad Order
Details;
   private static final String emailFromAddress = ;
public ActionForward perform(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
 {

   // Add List of Email address to who email needs to be sent to
String[] emailList = new String[2];
emailList[0]= new String([EMAIL PROTECTED]);
emailList[1]= new String([EMAIL PROTECTED]);

emailMsgTxt=Ad Order Details;

 try {
postMail( emailList, emailSubjectTxt,
emailMsgTxt, emailFromAddress);
  }catch (Exception e)
 {
  return
(mapping.findForward(mailfailure));
 }


}catch (Exception e) {
return (mapping.findForward(submitadfail));
 }

 return (mapping.findForward(target));

  }

  public void postMail( String recipients[ ], String subject,
String message , String from) throws
MessagingException
  {

boolean debug = false;

//Set the host smtp address
Properties props = new Properties();
props.put(mail.smtp.host, SMTP_HOST_NAME);
Session session = Session.getDefaultInstance(props,
null);

session.setDebug(debug);

 // set the from and to address
   InternetAddress addressFrom = new InternetAddress(from);
   msg.setFrom(addressFrom);

   InternetAddress[] addressTo = new
InternetAddress[recipients.length];
   for (int i = 0; i  recipients.length; i++)
   {
 addressTo[i] = new InternetAddress(recipients[i]);
   }
   msg.setRecipients(Message.RecipientType.TO, addressTo);


   // Setting the Subject and Content Type
   msg.setSubject(subject);
   msg.setContent(message, text/plain);
   Transport.send(msg);
}

   }
- Original Message -
From: Caroline Jen [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Wednesday, October 13, 2004 7:41 PM
Subject: Re: how to send batch emails


 I have been using the same utility class (JavaMail
 API) to send e-mails.  The code works OKay.

 Now, instead of the

 String toAddress

 I have String[] toAddress =
 selectRecipientsForm.getSelectedEmailAddresses();

 will the same code works for sending batch e-mails?



 --- Duncan Mills [EMAIL PROTECTED] wrote:

  Its pretty simple to plug in the JavaMail API -
  here's a Utility class I
  call from an Action I use when resetting a User
  Password: It's quick and
  dirty but provides an example.  The SMTP mail host
  is read from a
  properties file in this case, but equally could be
  passed in from the
  Appliciation scope. Note the total lack of  any kind
  of useful error
  handling in this example - I think I better re-write
  it :-)
 
  [--Badly formmated code begin--]
  package com.groundside.util;
  import java.io.IOException;
  import java.io.InputStream;
  import java.util.Properties;
  import javax.mail.Message;
  import javax.mail.MessagingException;
  import javax.mail.Session;
  import javax.mail.Transport;
  import javax.mail.internet.InternetAddress;
  import javax.mail.internet.MimeMessage;
 
  public class Emailer
  {