This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of Real-World Software Development: A Project-Driven Guide to Fundamentals in Java and have Dr. Raoul-Gabriel Urma & Richard Warburton on-line!
See this thread for details.
Win a flower (🌹) or copy of Real-World Software Development: A Project-Driven Guide to Fundamentals in Java (📚) this week in the Agile and Other Processes forum!

Kshitiz Agarwal

pioneer
+ Follow
since Dec 15, 2011
Apples and Likes
Apples
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Kshitiz Agarwal

Hi,

I am having problems in setting footer at the bottom of page when its content goes beyond window's height. The footer tends to over lap the content. Here is the code:



The css is :




Please help me here...I am really stuck....

Bear Bibeault wrote:Are you setting the content headers on the response correctly? Is the image data correct?

Likely easier to debug if you just type the URL for the image into the browser's address bar.

Use the browser tools to inspect the response for correctness.



Hi,

I am able to show image now. Actually parameters were not getting passed properly in the request. Now its all done....thank you very much for your help and time :)
7 years ago
JSP

Bear Bibeault wrote:That URL does not match the pattern you specified in the deployment descriptor.



Hi,

I have changed the mapping to



Servlet was not being called unitl I changed from handleRequest to doGet in servlet.
7 years ago
JSP

Bear Bibeault wrote:You need to prefix the url to the image with the context path. Use: ${pageContext.request.contextPath}



Hi,

You mean to say this...




But even then servlet is not being called. Its first line which is sysout is not getting executed. I have seen examples and people are actually using this approach only.
7 years ago
JSP

Bear Bibeault wrote:

ksh agarwal wrote:And i am calling it from jsp like this

<img />



Be sure to disable HTML when you post HTML code or your image tags will be empty.

Please repost with the real code.



Hi,

The image tag is
7 years ago
JSP

Bear Bibeault wrote:

ksh agarwal wrote:And i am calling it from jsp like this

<img />



Be sure to disable HTML when you post HTML code or your image tags will be empty.

Please repost with the real code.



Sorry...my mistake...the code is



PLease consider them under tags <> as I am not able to display those with tags...
7 years ago
JSP

Bear Bibeault wrote:The URL for the <img> tag needs to be to a servlet that sends the image data. Having the image blob in the JSP is not useful. Remember, JSP just creates HTML. When you write the page in HTML do you give the image tag a blob of data? No. You give it the URL of the image.



Hi,

I am trying to do the same as suggested by you...:

This is my servlet:



And i am calling it from jsp like this



with mapping in web.xml as




But even servlet is not being called...what i am doing wrong?
7 years ago
JSP
Hi,

I am trying to display image and its respective name from the database. The code is:



The above code is showing name but image is not getting displayed. If I use output stream (as commented), then name is not displayed. WHat should I do to make both of them appear?
7 years ago
JSP

Stefan Evans wrote:Specifically the flush="true" attribute is flushing the buffer, and committing the response.

You either need to
- remove the flush="true" attribute
- put the response.redirect earlier in the code

Another thing you may need to know.
Just because you TOLD the server to redirect the response doesn't mean the current page stops running
After issuing a forward/redirect, you should immediately return from your page.
Standard approaches:


or




Thank you....You have solved the problem..:)
7 years ago
JSP
Hi,

I am trying to learn JSP. I am trying to code a simple page with a form submission. The code is:





imageUploader.jsp




The code is really simple but I dont understand why I am getting the error:

java.lang.IllegalStateException
at org.apache.catalina.connector.ResponseFacade.sendRedirect(ResponseFacade.java:435)
at org.apache.jsp.imageUploader_jsp._jspService(imageUploader_jsp.java:139)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Unknown Source)




Please help me out here...
7 years ago
JSP

James Sutherland wrote:Also ensure your have your JPA provider jar on the classpath (in your case this would be toplink-essentials.jar)



I have already tested web service code by calling it locally and it is running. So I dont think so there would be any jar related problem. Jars are present in lib folder. The problem seems to be related to axis2 configuration. Checking out this link: https://issues.apache.org/jira/browse/AXIS2-5383

Bill Gorder wrote:Do you have a <provider> tag in your persistence.xml? It seems you do not have a persistence provider defined.



I did.....this is the provider:

<provider>oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider</provider>
Hi,

I am trying to use JPA in axis 2 web service producer but the I am getting the error:

**No Persistence provider for EntityManager**

Now, I have placed my persistence.xml in JPAcontent and web-inf/classes/meta-inf. Moreover, when I test my web service class by calling its respective method locally, it is running fine. Where do we have to place persistence.xml in case if axis2 project?
Hi,

I am trying to persist the following entity:



But the error comes out:

During synchronization a new object was found through a relationship that was not marked cascade PERSIST: entity.PostEntity@16afec.
but when I try to persist PostEntity, it is persisted. No such exception is thrown:



Why it is happening? UserEntity is:



I am using EclipseLink