saima kanwal

Ranch Hand
+ Follow
since Oct 05, 2009
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
(keep public parts private until JForum day)
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt
Moderation Tools

Recent posts by saima kanwal

Can anyone tell me how to wrap text in Comma Separated Value format? in jasper report The text I am trying to wrap are in the column header , which are static text. Is there any way that all the column headings are wrapped instead of merging. actually I have 9 columns, and in csv, some of the column heading are merged cells (3 of them) the others are not merged (since there is not much space), so only part of the heading text is shown by default. You have to drag the column width manually in excel sheet to view the full heading. I am supposed to make the heading visible by default. So in case it is not merge cells and wrap text, all of them will be visible. Please tell me how to wrap text?

The other thing that I tried increasing the page width so that all my column headings come on the page with merge cells and I do not need to wrap the text but the effect is displayed only in P.D.F and the comma separated value format (C.S.V) page width is not increased. Can anyone tell me how to increase the Comma separated value format page width?

saima
Thanks, it really helped me.
7 years ago
is it necessary to use a framework when designing a web application? Can't we design our application with just servlets and jsps and follow design patterns where needed without using any framework like struts or spring?? is it practical?? if not the what are the pros an cons of not using a framework?

7 years ago
ok i got the idea . thanks for correcting.
7 years ago
Oh yes , i was overrding it without calling the superclass's init. I think that's the mistake. Thanks .
7 years ago
@ David Newton: thanks for your suggestion of using a context listener. I will try with that. I am not accessing any JSPs directly. My app was working fine before overriding this init().And everything is just the same except that i extend ActionServlet to override the init() and entering its name in web.xml.

So... there's a single connection, in the application context?! That will almost never work--what happens if you have more than a single user? Or a single user with multiple windows/tabs open? Consider connection pooling, otherwise you were better off the way you had it originally.



I do not understand what you mean by single connection? can you please explain and tell me how to implement a pool of connections??
7 years ago
I am extending ActionServlet to override init() i order to make a the database connection with oracle. Previously I was making teh connection in each request, in the overridden action class and my application was working fine. But I think , the databse connection should be made once at the servlet initialization, and not at each request.

My overridden Action Servlet is :




my action class is :



web.xml is :




struts-config.xml is :




and the exception that i am getting is :

org.apache.jasper.JasperException: java.lang.NullPointerException: Module 'null' not found.
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:491)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:419)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

root cause

java.lang.NullPointerException: Module 'null' not found.
org.apache.struts.taglib.TagUtils.getModuleConfig(TagUtils.java:755)
org.apache.struts.taglib.TagUtils.computeURLWithCharEncoding(TagUtils.java:364)
org.apache.struts.taglib.TagUtils.computeURLWithCharEncoding(TagUtils.java:285)
org.apache.struts.taglib.html.LinkTag.calculateURL(LinkTag.java:445)
org.apache.struts.taglib.html.LinkTag.doEndTag(LinkTag.java:353)
org.apache.jsp.index_jsp._jspx_meth_html_005flink_005f0(index_jsp.java:114)
org.apache.jsp.index_jsp._jspService(index_jsp.java:70)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

note The full stack trace of the root cause is available in the Apache Tomcat/6.0.24 logs.

please help me out.
7 years ago
oh thanks guys. its now working . My ojdbc was in oracle folder. Now I have put it in my app's lib folder and its working as you people suggested.
I am getting this exception:

javax.servlet.ServletException: java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:286)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

root cause

java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1484)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1329)
java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
java.lang.Class.forName0(Native Method)
java.lang.Class.forName(Class.java:169)
com.jamesholmes.abc.SearchAction.execute(SearchAction.java:24)
org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58)
org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67)
org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:305)
org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

note The full stack trace of the root cause is available in the Apache Tomcat/6.0.24 logs.

I am using Struts 1.3.10 , oracle XE, and Tomcat-6.0.24. I am unable to access the data base because of this exception. My Action class is as follows:


There is a strange thing about it: previously I have been accessing the same database with the same statements for connection through a JSP, and I am able to access it and there is no such exception. (this JSP is not a part of the struts appplication that I discussed earlier, but it is using the same oracle XE database using the same connection statements , but in scriptlets. My JSP is as follows:



One thing to add here is that I have ojdbc14.jar and ojdbc14_g.jar in somewhere in lib directory of oracle XE that came with oracle XE itself.Is there any other driver to add in order to get conected to the database?


Anyone please solve my problem,i will be grateful.
can you please tell me how can i fix that? my index.jsp is :



web.xml is:



struts-config.xml is :



please tell me how can i prevent in index.jsp from accessing directly?
7 years ago
I typed the following link :

http://localhost:9000/ch03app

and my index.jsp is in the ch03app directory.
7 years ago
I have a little modification:

my index.jsp is:




my struts-config.jsp is :



now i m getting the following exception:

org.apache.jasper.JasperException: java.lang.NullPointerException: Module 'null' not found.
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:491)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:419)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

root cause

java.lang.NullPointerException: Module 'null' not found.
org.apache.struts.taglib.TagUtils.getModuleConfig(TagUtils.java:755)
org.apache.struts.taglib.TagUtils.getModuleConfig(TagUtils.java:735)
org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:818)
org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:488)
org.apache.jsp.index_jsp._jspx_meth_html_005fform_005f0(index_jsp.java:97)
org.apache.jsp.index_jsp._jspService(index_jsp.java:69)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)



am using struts 1.3 tomcat6.0.24
please help me out.i m stuck at my first trial app.
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.24 logs.
7 years ago
Anyone please help me out? I am stuck at the first step ?
7 years ago
my struts-config.xml is as follows : yes it has the mapping


7 years ago
I am a beginner , just read a book of struts and tried my first app on it. can anyone tell what is the problem with my code . it gives an error at line 7 :

<html:form action="/starFinder" >



my index.jsp is :

<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>



am i using the wrong tag ?? or is it something else??
7 years ago