Sakthi Ramasamy

Greenhorn
+ Follow
since Jun 02, 2008
Bangalore
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
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.
4 years ago
Hi,

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.
4 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...
5 years ago
JSP
Hi,

My Intended output is

Sample Output:

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


XML :




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?
Hi,

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

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

Sakthi.
8 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?
Hi,

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
java.io.FileNotFoundException: C:\localhost\AWCMS_S\web-inf\config\xml\ApplicationProperties.xml (The system cannot find the path specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at java.io.FileInputStream.<init>(FileInputStream.java:66)
at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:70)
at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:161)
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 org.jdom.input.SAXBuilder.build(SAXBuilder.java:453)
at org.jdom.input.SAXBuilder.build(SAXBuilder.java:891)
at com.oem.awcms.common.configloader.ConfigurationLoader.load(ConfigurationLoader.java:70)
at com.oem.awcms.common.configloader.ConfigurationService.initialize(ConfigurationService.java:83)
at com.oem.awcms.common.configloader.ConfigurationService.loadConfiguration(ConfigurationService.java:43)
at com.oem.awcms.common.configloader.GenericConfigServlet.init(GenericConfigServlet.java:37)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1029)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:862)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4013)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4357)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:789)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478)
at org.apache.catalina.core.StandardService.start(StandardService.java:480)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313)
at org.apache.catalina.startup.Catalina.start(Catalina.java:556)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:592)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425)
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 /0.0.0.0:8009
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
[/code]



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.

Regards,
Sakthi.
8 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...
8 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.
Hi,

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,
Sakthi.
8 years ago
JSP
Kindly have a look at my code....

GuestServlet.java

package com.msat.cloud;

import java.io.IOException;
import java.io.PrintWriter;
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() {
super();
// 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 {
Class.forName("com.mysql.jdbc.Driver").newInstance();
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 (rs.next()) {
rowCount++;
out.println("<tr border=\"1\">");

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

out.println("</tr>");

}
System.out.println(all);
out.println("</table></html>");
rs.close();
stmt.close();
con.close();


} catch (Exception e) {
e.printStackTrace();
}
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"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<body>
<table>
<tr>
<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");%>
</tr>
</table>


<form method="post" action="GuestBookServlet" >
<%! private int accessCount = 0; %>
<!--<H5>Page Hits: -->
<!--<%= ++accessCount %></H5>-->
<table>
<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>
</table>
</form>
</body>
</html>



I donot know how to post it in the same page.
8 years ago
JSP
Hi,

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.

Sakthi.
8 years ago