Ranjith Kodikara

Greenhorn
+ Follow
since Sep 03, 2002
Merit badge: grant badges
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Ranjith Kodikara

We are going to develop an inventory control application for our company any it's remote branches with a central database. So one of the suggestions is to use JSP/ Servlets to develop this application.

I have developed various J2ee applications, but never have done an inventory control app with J2ee.
Is J2EE good for an application like inventory control system? We have identified j2ee to do this, as it's said that Java Swing applications are quite slow.

If we develop this inventory control application with j2ee to run in web browser, I wonder how the validations are done. Users may demand GUI controls like calendar, which is available in client server applications.
If you guys can give me an idea to help whether our decision to develop this app in j2ee is correct or not, it will help us a lot.

Thanks in advance,
Ranjith Kodikara (SCJP,SCWCD)
18 years ago
JSP
We are going to develop an inventory control application for our company any it's remote branches with a central database. So one of the suggestions is to use JSP/ Servlets to develop this application.

I have developed various J2ee applications, but never have done an inventory control app with J2ee.
Is J2EE good for an application like inventory control system? We have identified j2ee to do this, as it's said that Java Swing applications are quite slow.

If we develop this inventory control application with j2ee to run in web browser, I wonder how the validations are done. Users may demand GUI controls like calendar, which is available in client server applications.
If you guys can give me an idea to help whether our decision to develop this app in j2ee is correct or not, it will help us a lot.

Thanks in advance,
Ranjith Kodikara (SCJP,SCWCD)
[email protected]
18 years ago
Dear Ali,

I put the code you have posted in web.xml, but still it's not working at all. Still I get the same HTTP Status 404 - /jsfbean2/Register.jsf Error.

I deleted all stuff in tomcat works directory and checked, whether it's cached and then I cleared browser cache also.. But still the output is same ...

Any Idea please...

Thanks and best regards,
Ranjith odikara
[email protected]
18 years ago
JSF
Thanks a lot for your reply. I will list all the files in my web app here because it is a very simple web app with a single jsp page and only one jsf backing bean.


The war file's name is jsfbean2, so the extracted folder name is also the same.

The URL's I tried are,


http://127.0.0.1:8080/jsfbean2/faces/Register.jsp
http://127.0.0.1:8080/jsfbean2/Register.jsp
http://127.0.0.1:8080/jsfbean2/Register.jsf
http://127.0.0.1:8080/jsfbean2/Register.faces
http://127.0.0.1:8080/jsfbean2/faces/Register
All those gives HTTP Status 404 Error...

INSIDE WEB-INF
My web.xml file:
<?xml version = '1.0' encoding = 'windows-1252'?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee">
<description>Empty web.xml file for Web Application</description>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>35</session-timeout>
</session-config>
<mime-mapping>
<extension>html</extension>
<mime-type>text/html</mime-type>
</mime-mapping>
<mime-mapping>
<extension>txt</extension>
<mime-type>text/plain</mime-type>
</mime-mapping>
</web-app>



and my faces-config.xml file (INSIDE WEB-INF):
<?xml version="1.0" encoding="windows-1252"?>
<!DOCTYPE faces-config PUBLIC
"-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
"http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
<faces-config xmlns="http://java.sun.com/JSF/Configuration">
<managed-bean>
<managed-bean-name>personData</managed-bean-name>
<managed-bean-class>proj1.PersonInfo</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
</faces-config>



In classes/proj1 folder PersonInfo.class
it's source code:

package proj1;

public class PersonInfo {
public PersonInfo() {
}

private String username;
private String email;

public void setUsername(String username) {
this.username = username;
}

public String getUsername() {
return username;
}

public void setEmail(String email) {
this.email = email;
}

public String getEmail() {
return email;
}

public void saveInfo (String name, String mail) {
System.out.println("saving..." + name + " " + mail);
}

public String commandButton_action() {
saveInfo (this.username, this.email);
return null;
}
}



Outside the WEB-INF folder, there is only one jsp file.
Register.jsp

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@ page contentType="text/html;charset=windows-1252"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://xmlns.oracle.com/adf/faces" prefix="af"%>
<%@ taglib uri="http://xmlns.oracle.com/adf/faces/html" prefix="afh"%>
<f:view>
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=windows-1252"/>
<title>Home Page</title>
<style type="text/css">
body {
background-color: #ffefd6;
}
</style>
</head>
<body><font size="4">
<font color="#0000ff">
<h:form>
<p>
<font face="Andale Sans" size="5" color="#ff9494">
<strong>Registration Form</strong>
</font>
</p>

<table cellspacing="2" cellpadding="3" border="1" width="100%">
<tr>
<td>
<font color="#ff8484">
User Name
</font></td>
<td>
<font color="#ff8484">
<h:inputText value="#{personData.username}"/>
</font>
</td>
</tr>
<tr>
<td>
<font color="#ff8484">
Email
</font></td>
<td>
<font color="#ff8484">
<h:inputText value="#{personData.email}"/>
</font>
</td>
</tr>
<tr>
<td>
<font color="#ff8484">
 
</font></td>
<td>
<font color="#ff8484">
<h:commandButton value="Sign Up !"
action="#{personData.commandButton_action}"/>
</font>
</td>
</tr>
</table>
<p>
 
</p>
</h:form>
</font>
</font></body>
</html>
</f:view>
<%--
oracle-jdev-comment referred-managed-bean-name ersonData
--%>

Thanks for your kind attention!

Ranjith Kodikara (SCJP,SCWCD)
[email protected]
18 years ago
JSF
Hi,
I am a beginner in JSF. I created some web applications with JSF using Oracle JDeveloper. Thse are correctly running on JDeveloper's in-built oc4j. I deployed those applications on Tomcat and Jboss. Those are not working on non of those. I dont know the corrct url to be called for the web application running on tomcat or jboss. I tried my best according to the url's I tested on Oc4j.

I dont know whether it's possible to attch the war file with this forum. I have the WAR file with me, and it's correctly extracted in the webapps folder of the Tomcat 5.5.20. But in the Internet Explorer, it gives the HTTP Status 404 error message.

Any help will be greatly appreciated.

Thanks,
Ranjith Kodikara (SCJP,SCWCD)
[email protected]
18 years ago
JSF
Thank you very much Paul. I read the article you reffered and it contains the information I requested. Your help is very much appreciated.

When further looking at this matter, I found that there is a webapp folder in Jasper sample applications. Its coming with the Jasper installation package.

If someone is looking for the answer to j2ee-jasper integration, that webapp sample directory's path is jasperreports-1.2.3\demo\samples\webapp.


Thanks,
Ranjith ([email protected])
Hi,
I am evaluating Jasper for some of my future projects. I want to know whthwe Jasper can be used inside Tomcat or other servlet container to present report to users. In an standalone application, I can generate a .pdf type report to a directory of OS. If I use a servlet, will I be able to give the .pdf report as the servlet output? (This is like setting contentType we can out put an xml file instead of html. Like that can we give the .pdf report as output??). If you have sample source code, it will be fine too.

I would be grateful for your help and it's very much appreciated.

Thanks and best regards,
Ranjith
I have a jsp file written and its contentType is set to "application/msword"
<%@page contentType="application/msword"%>

There is an image included in the file as <img src= ... and the image exists in the correct

place. But I cant see the image in the word document.
If I set contentType to "text/html" it displays the image properly.

when jsp generates a word document there is only a frame that normally appears when the image

is not in place. But image is in place.

If you can write me how to display an image in a word document that generates through a jsp

with setting contentType to application/msword, I would be grateful.

Thanks and best regards,
Ranjith
rajith at dmsswt dot com
20 years ago
JSP
Many people say using java swing applications, client server apps are very slow. For a client server application, isnt java swing good?
Ranjith
21 years ago
I am using JDBC ODBC Driver which is bundled with Java 1.4 . But some SQL functions are not run on Access like NVL. Instead of NVL Access have Nz function. Through this driver I cant execute that function.
Is there a place that I can see all the functions and all commands (SQL) that I can run on MS Access through JDBC ODBC Driver? There should be a separete function that fills the gap of NVL, but run on MS Access through JDBC ODBC Driver. But I am seeking that function or a documentation.
Regards,
Ranjith
ranjith at dmsswt dot com
I am using JDBC ODBC Driver which is bundled with Java 1.4 . But some SQL functions are not run on Access like NVL. Instead of NVL Access have Nz function. Through this driver I cant execute that function.
Is there a place that I can see all the functions and all commands (SQL) that I can run on MS Access through JDBC ODBC Driver? There should be a separete function that fills the gap of NVL, but run on MS Access through JDBC ODBC Driver. But I am seeking that function or a documentation.
Regards,
Ranjith
ranjith at dmsswt dot com
Dear friends,
I want to use NVL function of SQL with my query. HOw can I use that function with access through JDBC ODBC driver. NVL returns a specified value if the column value is null. There should be a function to use for this purpose. But I dont know that. If you know it pls write me.
Thanks and best regards,
Ranjith
Dear friends,
I am connectiong to a MS Access database throgh JDBC ODBC bridge and I am running my JSP on Tomcat 4.
This is the query :
SELECT Nz(FIRST_NAME,'')+' '+ Nz(MIDDLE_INITIALS,'')+' '+ Nz(LAST_NAME,'')
AS full_name
FROM PASSENGER_DETAILS
This query runs on MS Access ok without a problem. But Tomcat's console gives this error message and it doesnt work.
SQLException: [Microsoft][ODBC Microsoft Access Driver] Undefined function 'Nz' in expression.
I would be grateful If you can help.
Thanks and regards,
Ranjith
ranjith at dmsswt dot com
Hi,
I am also facing the same problem. I deleted jaxp.jar and parser.jar from tomcat/lib dirctory as you have said in this forum. But after that, I coudnt start tomcat. ( I deleted names of those files from tomcat/conf directory files)
I am using tomcat 3.2 . Cant I parse with SAX with this version of Tomcat? What should I do as a solution to this problem.
Still I got stuck here and cannot proceed. Any help is greatly appreciated.
Thanks and Best Regards,
Ranjith
[email protected]
I was preparing for SCJP 1.3, But now they introduced SCJP 1.4 . then I am hoping to sit to the 1.4 exam, but I am scared because I dont know what are the content and topics of 1.4 exam. As I heard there are not books for 1.4 still written.
How can I find details about this 1.4 exam? Can I find some Mock exams and good books for 1.4?
Ranjith