Struts and Jasper Reports

2005-02-25 Thread Saurabh Bhatla
hi all 
  I am trying to use jasper reports in struts but when i try to compile
the report, the JasperCompileManager can not find the .jrxml file.

any suggestions?

-saurabh


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



RE: validate in ActionForm not working for errors

2004-08-30 Thread Saurabh Bhatla
hi Jim
  i had tried index.jsp too but it didnt work. I also tried sending it
back to another page but that didnt work either.

what should i do, i m stuck

regards
saurabh

On Mon, 2004-08-30 at 16:47, Jim Barrows wrote:
> > -Original Message-
> > From: Saurabh Bhatla [mailto:[EMAIL PROTECTED]
> > Sent: Monday, August 30, 2004 2:41 PM
> > To: Struts Users Mailing List
> > Subject: RE: validate in ActionForm not working for errors
> > 
> > 
> > Hi jim
> > 
> > here is the snippet from struts-config.xml
> > 
> >  >type="prototype.beans.LogonAction"
> >name="logonForm"
> >validate="true"
> >scope="request"
> >input="index">
> 
>   I think this needs to be /index.jsp, not just index. Unless index is your 
> tiles definition... In which case try /index.jsp and see if it works.. if it does 
> then you mave something going on with tiles.
> 
> 
> >   
> >  
> > 
> > 
> > and here is the snippet from LogonForm
> > 
> > 
> > 
> > public ActionErrors validate(ActionMapping actionMapping,
> > HttpServletRequest request) 
> > {
> > ActionErrors errors = new ActionErrors(); 
> > if(getName().trim().equals("") || getName()==null)
> > errors.add("name",new ActionError("errors.name.required"));
> > if(getPassword().trim().equals("") || getPassword()==null)
> > errors.add("password",new 
> > ActionError("errors.passwd.required"));
> > 
> > return errors; 
> >     
> > }
> > 
> > and here is relevant portion of jsp
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> >  
> > 
> > 
> >   .table information
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > regards
> > saurabh
> > 
> > 
> > 
> > On Mon, 2004-08-30 at 16:31, Jim Barrows wrote:
> > > > -Original Message-
> > > > From: Saurabh Bhatla [mailto:[EMAIL PROTECTED]
> > > > Sent: Monday, August 30, 2004 2:29 PM
> > > > To: struts
> > > > Subject: validate in ActionForm not working for errors
> > > > 
> > > > 
> > > > hi all,
> > > > I have a simple form that takes username and passwd. for 
> > > > that i have
> > > > a LogonForm bean, which has a validate method. if i enter 
> > > > both username
> > > > and passwd it works fine and gets forwarded to the next 
> > page. but if
> > > > there is an error in validate() and ActionErrors object is 
> > > > returned then
> > > > my control goes to a blank page. I know that my ActionErrors 
> > > > object has
> > > > been populated as i have checked it with debug statements. 'input'
> > > > property in my action mapping is to index.jsp, that is the 
> > > > page itself.
> > > > why is it showing me a blank page. why is the framework not 
> > > > showing any
> > > > exception if there is one. 
> > > > 
> > > > any suggestions
> > > 
> > > could you show us the relevant portions of your 
> > struts-config.xml, index.jsp and the validate method?
> > > Given what you said it's probably a typo, or something very subtle.
> > > 
> > > 
> > -
> > > 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: validate in ActionForm not working for errors

2004-08-30 Thread Saurabh Bhatla
Hi jim

here is the snippet from struts-config.xml


  
 


and here is the snippet from LogonForm



public ActionErrors validate(ActionMapping actionMapping,
HttpServletRequest request) 
{
ActionErrors errors = new ActionErrors(); 
if(getName().trim().equals("") || getName()==null)
errors.add("name",new ActionError("errors.name.required"));
if(getPassword().trim().equals("") || getPassword()==null)
errors.add("password",new ActionError("errors.passwd.required"));

return errors; 

}

and here is relevant portion of jsp












 


  .table information








regards
saurabh



On Mon, 2004-08-30 at 16:31, Jim Barrows wrote:
> > -Original Message-
> > From: Saurabh Bhatla [mailto:[EMAIL PROTECTED]
> > Sent: Monday, August 30, 2004 2:29 PM
> > To: struts
> > Subject: validate in ActionForm not working for errors
> > 
> > 
> > hi all,
> > I have a simple form that takes username and passwd. for 
> > that i have
> > a LogonForm bean, which has a validate method. if i enter 
> > both username
> > and passwd it works fine and gets forwarded to the next page. but if
> > there is an error in validate() and ActionErrors object is 
> > returned then
> > my control goes to a blank page. I know that my ActionErrors 
> > object has
> > been populated as i have checked it with debug statements. 'input'
> > property in my action mapping is to index.jsp, that is the 
> > page itself.
> > why is it showing me a blank page. why is the framework not 
> > showing any
> > exception if there is one. 
> > 
> > any suggestions
> 
> could you show us the relevant portions of your struts-config.xml, index.jsp and the 
> validate method?
> Given what you said it's probably a typo, or something very subtle.
> 
> -
> 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]



validate in ActionForm not working for errors

2004-08-30 Thread Saurabh Bhatla
hi all,
I have a simple form that takes username and passwd. for that i have
a LogonForm bean, which has a validate method. if i enter both username
and passwd it works fine and gets forwarded to the next page. but if
there is an error in validate() and ActionErrors object is returned then
my control goes to a blank page. I know that my ActionErrors object has
been populated as i have checked it with debug statements. 'input'
property in my action mapping is to index.jsp, that is the page itself.
why is it showing me a blank page. why is the framework not showing any
exception if there is one. 

any suggestions

regards
saurabh




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



Cannot find message resources......

2004-08-17 Thread Saurabh Bhatla
Hi all, 
  I got the following exception in struts-example on the very first page


exception

javax.servlet.ServletException: Cannot find message resources under key 
org.apache.struts.action.MESSAGE

org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)

org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
org.apache.jsp.logon_jsp._jspService(logon_jsp.java:101)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

root cause

javax.servlet.jsp.JspException: Cannot find message resources under key 
org.apache.struts.action.MESSAGE

org.apache.struts.util.RequestUtils.retrieveMessageResources(RequestUtils.java:1103)
org.apache.struts.util.RequestUtils.message(RequestUtils.java:1043)
org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:294)
org.apache.jsp.logon_jsp._jspx_meth_bean_message_0(logon_jsp.java:166)
org.apache.jsp.logon_jsp._jspx_meth_html_html_0(logon_jsp.java:123)
org.apache.jsp.logon_jsp._jspService(logon_jsp.java:92)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


 Why am i getting this exception

regards
saurabh


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



Re: java application to struts

2004-08-17 Thread Saurabh Bhatla
Erik,
  then my question is what do i need to change in .xml file if i dont
want anything to be returned back to the application from struts?.
reading and writing to the stream is handled manually in servlets. Will
it be like if i dont apecify  in .xml file then nothing will be
returned to the application.
regards
saurabh

On Tue, 2004-08-17 at 10:26, Erik Weber wrote:
> To your HTTP client, there should be no difference between a Struts app 
> and any other Servlet-based app (or HTTP server app for that matter).
> 
> Right?
> 
> Erik
> 
> Saurabh Bhatla wrote:
> 
> >Hi all,
> >   I have my web application based on struts framework. This application
> >takes some information from the user. I can submit information using jsp
> >but now i want to have a java application that would connect to my
> >webapplication using http connection and submit the information. I know
> >I can do that if I have a servlet. Now my question is how do that with
> >struts. What will be action mapping and all that information. 
> >
> >Any suggestions
> >regards
> >saurabh
> >
> >
> >-
> >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]



java application to struts

2004-08-17 Thread Saurabh Bhatla
Hi all,
   I have my web application based on struts framework. This application
takes some information from the user. I can submit information using jsp
but now i want to have a java application that would connect to my
webapplication using http connection and submit the information. I know
I can do that if I have a servlet. Now my question is how do that with
struts. What will be action mapping and all that information. 

Any suggestions
regards
saurabh


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



RE: connection pooling

2004-08-16 Thread Saurabh Bhatla
Jim,
  I understand most part of it now. the only thing that i dont
understand is how will the connection pooling be handled. I am using
tomcat 5. will the following code(from the link that u sent me) serve
the purpose?







.
.
.
..

regards
saurabh



On Mon, 2004-08-16 at 16:45, Jim Barrows wrote:
> > -Original Message-
> > From: Saurabh Bhatla [mailto:[EMAIL PROTECTED]
> > Sent: Monday, August 16, 2004 2:42 PM
> > To: Struts Users Mailing List
> > Subject: RE: connection pooling
> > 
> > 
> > Jim,
> >I am sorry but I am confused now. Just correct me if I am
> > wrong I want to call my DAO from my Action class. So 
> > the snippet
> > that you sent me would go in my DAO class in the function
> > getConnection() (or something like that). 
> 
> Yes, that is correct.  I acutally implment that in my DaoFactory class, and put the 
> resultant connection from the data source in the DaoFactory class.  That allows me 
> to easily de-couple the dao class for testing.
> 
> >  And if what I said is correct then does it mean that I 
> > dont need to
> > have a connection pool class and my webserver would handle everything
> > for me.
> 
> Depends on the web server... websphere has it's own, tomcat allows you to have 
> several choices, and I have no idea what BEA does.
> 
> 
> > 
> > regards
> > saurabh
> > 
> > On Mon, 2004-08-16 at 16:29, Jim Barrows wrote:
> > > > -Original Message-
> > > > From: Saurabh Bhatla [mailto:[EMAIL PROTECTED]
> > > > Sent: Monday, August 16, 2004 2:24 PM
> > > > To: Struts Users Mailing List
> > > > Subject: Re: connection pooling
> > > > 
> > > > 
> > > > David,
> > > >   But i want to make a business layer and call the DAO 
> > from there.  I
> > > > think that the links that you have sent me couple 
> > > > presentation layer and
> > > > database tightly. I know i can use EJB for presentation layer 
> > > > but I dont
> > > > want that as it would be overkill for the small project I am 
> > > > working on.
> > > > I want to have a connection pool class initialized at the time the
> > > > server starts and then all my DAO  should get the 
> > connection from that
> > > > pool. Is it possible?
> > > >   I am a beginner in this field and I might not understand it
> > > > completely. please correct me if i am wrong.
> > > 
> > > Ah, okay.. I also posted a link to the struts way to do the 
> > JNDI data source stuff in that case.. you follow your web 
> > app servers guide on how to setup a data source, then you 
> > follow the destructions for a normal jndi data source. Something like:
> > > 
> > > /**
> > >  * 
> > >  */
> > > public static DataSource getDataSource() throws 
> > NamingException {
> > > if (ds == null) {
> > > Context ctx = (Context) new InitialContext();
> > > ds =
> > > (DataSource) ctx.lookup(
> > > "jdbc/yourDataSource);
> > > }
> > > return ds;
> > > }
> > > 
> > > > regards
> > > > saurabh
> > > > 
> > > > 
> > > > 
> > -
> > > > 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]
> 
> 


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



Re: connection pooling

2004-08-16 Thread Saurabh Bhatla
yeah, I am planning to use OJB for persistence. Thankx for your advice.

regards
saurabh

On Mon, 2004-08-16 at 16:43, David Durham wrote:
> Jim Barrows wrote:
> 
> > Ah, okay.. I also posted a link to the struts way to do the JNDI data 
> > source stuff in that case.. you follow your web app servers guide 
> > on how to setup a data source, then you follow the destructions for a 
> > normal jndi data source. Something like:
> 
> Additionally, Saurabh, have you considered using something like OJB or 
> Hibernate?
> 
> http://db.apache.org/ojb/
> http://www.hibernate.org/
> 
> I understand that you have limited experience in this area 
> (persistence),  but these tools can greatly simplify storing and 
> retrieving objects from a relational database.
> 
> 
> - Dave
> 
> 
> -
> 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: connection pooling

2004-08-16 Thread Saurabh Bhatla
Jim,
   I am sorry but I am confused now. Just correct me if I am
wrong I want to call my DAO from my Action class. So the snippet
that you sent me would go in my DAO class in the function
getConnection() (or something like that). 
 And if what I said is correct then does it mean that I dont need to
have a connection pool class and my webserver would handle everything
for me.

regards
saurabh

On Mon, 2004-08-16 at 16:29, Jim Barrows wrote:
> > -Original Message-
> > From: Saurabh Bhatla [mailto:[EMAIL PROTECTED]
> > Sent: Monday, August 16, 2004 2:24 PM
> > To: Struts Users Mailing List
> > Subject: Re: connection pooling
> > 
> > 
> > David,
> >   But i want to make a business layer and call the DAO from there.  I
> > think that the links that you have sent me couple 
> > presentation layer and
> > database tightly. I know i can use EJB for presentation layer 
> > but I dont
> > want that as it would be overkill for the small project I am 
> > working on.
> > I want to have a connection pool class initialized at the time the
> > server starts and then all my DAO  should get the connection from that
> > pool. Is it possible?
> >   I am a beginner in this field and I might not understand it
> > completely. please correct me if i am wrong.
> 
> Ah, okay.. I also posted a link to the struts way to do the JNDI data source 
> stuff in that case.. you follow your web app servers guide on how to setup a 
> data source, then you follow the destructions for a normal jndi data source. 
> Something like:
> 
> /**
>  * 
>  */
> public static DataSource getDataSource() throws NamingException {
> if (ds == null) {
> Context ctx = (Context) new InitialContext();
> ds =
> (DataSource) ctx.lookup(
> "jdbc/yourDataSource);
> }
> return ds;
> }
> 
> > regards
> > saurabh
> > 
> > 
> > -
> > 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: connection pooling

2004-08-16 Thread Saurabh Bhatla
David,
  But i want to make a business layer and call the DAO from there.  I
think that the links that you have sent me couple presentation layer and
database tightly. I know i can use EJB for presentation layer but I dont
want that as it would be overkill for the small project I am working on.
I want to have a connection pool class initialized at the time the
server starts and then all my DAO  should get the connection from that
pool. Is it possible?
  I am a beginner in this field and I might not understand it
completely. please correct me if i am wrong.
regards
saurabh


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



connection pooling

2004-08-16 Thread Saurabh Bhatla
Hi all, 
   I have just started working with struts a few days ago, and I
understand most of it. The only thing that i dont understand is, if i
make a connection pool then where will it be initialized. In servlets I
know that it can be done in the init() method but in struts framework
there is nothing like an init() method. I have the connection pool class
that i have written and i was using in one of my servlets. Now i want to
know how to initialize the connection pool object and how to pass that
object to all Action classes.

Any suggestion would be greatly appreciated.

regards
saurabh


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