Win a copy of Python Continuous Integration and Delivery this week in the Python forum!

Sakthi Ramasamy

+ Follow
since Jun 02, 2008
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Sakthi Ramasamy

We use the <img src =""> for the HTML page, but the challenge encountered is that the image is being retrieved as a BLOB Object (Stream). The HTML img tag expects an image from the filesystem and not a stream., I believe.
5 years ago

We are developing a GUI in JSP, using Struts 1.1 version, which has the following requirement.
Req 1. (Screen 1): Upload the Image from the GUI and store it in the database and add an description for it.
Req 2. (Screen 2): A Combo box should populate the Image Description.
Req 3. (Screen 2): On selection of the Image Description (as described above), the corresponding image should be retrieved from the database and populated in the GUI.

Completed Steps: Req 1 and Req 2.

Help Needed Area: Req 3

Req 3 needs some expert advice on how to do it. we were thinking of using the plain Ajax to enrich the user experience but we were struggling to display the image, since we were running short of time and we were lacking the expertise in it.

I profoundly thank you, if you could share any ideas / help to proceed forward.
5 years ago
We have a JSP File which holds more than 8050 lines of code. When we try to add new lines, the WAS server complains that the file has exceeded its maximum size.

Is there any solution available to add further lines to the JSP file? Any suggestions would be much appreciated...

We have tried JSP Fragments but it is not able to pass the values to and fro....

Thanks in advance...
6 years ago

My Intended output is

Sample Output:

Centrifugal | Booster Pumps and Systems | 1PGG7 | 10149_BRAND | 2PC24_AS01 | 0123


My Java Code is:

Could anybody please debug it for me...I am getting null for everything...
I have very large XMLs which has huge chunk of data. Which parser is best to use for processing and retrieval of the data? I tried with DOM but it is throwing Heap Memory Exception. The XML Files are more than 8 MB. Is Castor API a better one to try out?

I have a xml file which is of 8 Mb and it includes data for 897 products. All i have to do is to extract data from XML file and put it to any database. Is there any tools are code available for doing such task? I am clueless about its implementation. Kindly help me if you know the solution.

[code] <Values>
<Value AttributeID="RELATIONSHIP_MANAGER_CODE">T52</Value>
<Value AttributeID="RESTRICTION_STATUS_FLAG">Y</Value>
<Value AttributeID="FOREIGN_LANGUAGE_MANUAL_FLAG">Y</Value> [/code]

Could anyone tell me a good Java based Barcode decoder that is capable of taking image files as input and classifying them accordingly on standards and providing the desired barcode values?

Thanks in advance...

9 years ago
I have a Composite key and i need only one of its key to get auto incremented. How is it possible to do it in Hibernate?

I have set that key in MySQL Database to be a auto-increment but it is not functioning properly. I am encountering the following scenario. Actually the MySQL sequence starts with 1000, but while inserting to frontend, the first Primary key generated is 2 [not 1] and then 3, from third insertion onwards it is getting updated on 3 and no insertion is performed. Is it because of some session issues?

Could you please let me know how to make the CAMPAIGN_ID in the composite key to be auto generated [Sequence starting from 1000 and thereby incremented by 1]. I have a MySQL query for Sequence generation.

The problem is, whenever i create a campaign, after 2, its getting updated instead of insert. Is it because of hbm files or is it because of some session updation in java code.

I couldn't come to conclusion why it is behaving so.

Thanks in advance for your time.
[code] Jan 6, 2010 5:03:57 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Jan 6, 2010 5:03:57 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1141 ms
Jan 6, 2010 5:03:57 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Jan 6, 2010 5:03:57 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.0.28
Jan 6, 2010 5:03:58 PM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
Jan 6, 2010 5:03:58 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(D:\My Documents\Workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\AWCMS_S\WEB-INF\lib\javax.servlet-5.1.12.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
Jan 6, 2010 5:03:58 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(D:\My Documents\Workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\AWCMS_S\WEB-INF\lib\servlet-api-2.4.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
Jan 6, 2010 5:03:58 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(D:\My Documents\Workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\AWCMS_S\WEB-INF\lib\servlet-api-2.5-6.0.0beta9.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class C:\localhost\AWCMS_S\web-inf\config\xml\ApplicationProperties.xml (The system cannot find the path specified)
at Method)
at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at com.oem.awcms.common.configloader.ConfigurationLoader.load(
at com.oem.awcms.common.configloader.ConfigurationService.initialize(
at com.oem.awcms.common.configloader.ConfigurationService.loadConfiguration(
at com.oem.awcms.common.configloader.GenericConfigServlet.init(
at org.apache.catalina.core.StandardWrapper.loadServlet(
at org.apache.catalina.core.StandardWrapper.load(
at org.apache.catalina.core.StandardContext.loadOnStartup(
at org.apache.catalina.core.StandardContext.start(
at org.apache.catalina.core.ContainerBase.start(
at org.apache.catalina.core.StandardHost.start(
at org.apache.catalina.core.ContainerBase.start(
at org.apache.catalina.core.StandardEngine.start(
at org.apache.catalina.core.StandardService.start(
at org.apache.catalina.core.StandardServer.start(
at org.apache.catalina.startup.Catalina.start(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at org.apache.catalina.startup.Bootstrap.start(
at org.apache.catalina.startup.Bootstrap.main(
Jan 6, 2010 5:04:10 PM org.apache.catalina.core.StandardHost getDeployer
INFO: Create Host deployer for direct deployment ( non-jmx )
Jan 6, 2010 5:04:10 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Jan 6, 2010 5:04:10 PM org.apache.jk.common.ChannelSocket init
INFO: JK2: ajp13 listening on /
Jan 6, 2010 5:04:10 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/31 config=null
Jan 6, 2010 5:04:10 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 12516 ms

I have all necessary jars in web-inf/lib folder...but still i am getting this in server's console...i am using tomcat 5...

Thanks in advance.

9 years ago
I believe that static gets initialized/invoked [thats why you have main() as static] at the time of class loading...checkout and you are right on understanding...
9 years ago
If it is in eclipse, in the bottom left corner you find the small icon when clicked expands, select servers option,

1. right click JBoss server
2. you can notice timeout in seconds there
3. Increase it

Restart the server, and i am sure this time you wont get that error.

The reason for duplicate post is the thought that my post might not get noticed. but i clicked the resolved option as i didn't know how to delete the post.

I am [b]extremely sorry[/b] for the people, whose time i have wasted and caused some irritation.

[u]I thank you very much for the ideas that you have provided for me to solve the issue[/u].

I assure that the next time i post some issues, i will follow the rules.

Best Regards,
9 years ago
Kindly have a look at my code....


import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.Statement;
import java.util.ArrayList;

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

* Servlet implementation class GuestBookServlet
public class GuestBookServlet extends HttpServlet {
private static final long serialVersionUID = 1L;

* @see HttpServlet#HttpServlet()
public GuestBookServlet() {
// TODO Auto-generated constructor stub

* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse
* response)
protected void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub

* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse
* response)
protected void doPost(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub

PrintWriter out = response.getWriter();

String name = request.getParameter("name");
String email = request.getParameter("email");
String comments = request.getParameter("comments");

int rowCount = 1;

try {
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/cloudmsat?user=root&password=welcome");
Statement stmt = con.createStatement();

stmt.executeUpdate("insert into guestbook3 values('" + name
+ "','" + email + "','" + comments + "');");

ResultSet rs = stmt.executeQuery("select * from guestbook3");

ResultSetMetaData resultsMetaData = rs.getMetaData();

int columnCount = resultsMetaData.getColumnCount();

out.println("<html><table width=\"100%\" datapagesize=\"80%\" border=\"1\" >");
out.println("<TR color=\"Gray\"><TD bgcolor=\"Gray\">Name</TD><TD bgcolor=\"Gray\">EMail</TD><TD bgcolor=\"Gray\">Comments</TD></TR>");
ArrayList all=new ArrayList();
while ( {
out.println("<tr border=\"1\">");

for (int i = 1; i <= columnCount; i++) {
out.println("<td>"+ rs.getString(i)+"</td>");
request.setAttribute("all", all);



} catch (Exception e) {
if (name== null || email== null || comments == null){
out.println("The guestbook cannot be signed if you have left any of the fields blank");
out.println("you are the guest No: "+ rowCount);

MyJSP Page

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">
<jsp:useBean id="list" class="java.util.ArrayList" scope="session"/>
<jsp:useBean id="it" class="java.util.Iterator" scope="session"/>
<%String book=request.getParameter("all");%>

<form method="post" action="GuestBookServlet" >
<%! private int accessCount = 0; %>
<!--<H5>Page Hits: -->
<!--<%= ++accessCount %></H5>-->
<tr><td>Name:</td> <td><input type="text" name="name" size="20" maxlength="50"></td></tr>
<tr><td>Email:</td> <td><input type="text" name="email" size="20" maxlength="50"></td></tr>
<tr><td><br>Your comments:</td><td><br><textarea name="comments" cols="30" rows="5"></textarea></td></tr>
<tr><td></td><td><br></br><input type="submit" value="Submit"></td></tr>

I donot know how to post it in the same page.
9 years ago

In Model2 Architecture i use <%=rs.getString(1)%> to populate the resultset objects in JSP.

When you use multi-tiered application, how to transfer a large set of data from DAO layer to Presentation Layer? I tried to use ArrayList but i wonder why i am not getting idea of how to take it to JSP layer.

Kindly explain any tutorials for it or what are the available methodologies to present it in JSP.

I am grateful for everyone can guide me in achieving a solution for this.

Thank you very much.

9 years ago