Prashant Vasudeo

Ranch Hand
+ Follow
since Mar 25, 2003
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Prashant Vasudeo

I have a Orace DB in India. one field is Date. This field value is inserted from a stored procudure. I mean java code is not providing this date value.

I get the Date value in following way
1. get Result Set
2. using resultset metadata, if my datatype is timestamp (i.e. Date)
then create a new Date object.
java.sql.Timestamp timestamp = (Timestamp) date;
return new Date(timestamp.getTime());

I am displaying this data using Date.toString() with Date formatter as "EEE, MMM d 'at' HH:mm:ss z"

Problem Desc ::
When i run my application server in India
It shows me TimeZone as IST
From one week when i run my application server in EU-London
all dates from one week, Its showing TimeZone as BST (British Summer Time)
But dates before one weeks, shows in GMT

Any help ?

Prashant
15 years ago
Hi done the changes

Still picks the 3.1 hibernate and not 3.3

-------------------------------------------------
[org.hibernate.cfg.Environment] Hibernate 3.1 [org.hibernate.cfg.Environment] hibernate.properties not found [org.hibernate.cfg.Environment] using CGLIB reflection optimizer [org.hibernate.cfg.Environment] using JDK 1.4 java.sql.Timestamp handling [org.hibernate.cfg.Configuration] configuring from resource: /hibernate.qa.cfg.xml [org.hibernate.cfg.Configuration] Configuration resource: /hibernate.qa.cfg.xml [org.hibernate.util.DTDEntityResolver] trying to locate http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd in classpath under org/hibernate/ [org.hibernate.util.DTDEntityResolver] found http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd in classpath [org.hibernate.cfg.Configuration] dialect=org.hibernate.dialect.DB2Dialect [org.hibernate.cfg.Configuration] show_sql=true [org.hibernate.cfg.Configuration] hibernate.format_sql=false [org.hibernate.cfg.Configuration] use_outer_join=false

My unix server is configured for server as "all" and not "default"

I downloaded Jboss4.0.3 Windows version and without changing any thing i deployed the war file with jboss-web.xml It is picking jar from WEB-INF/lin folder i.e 3.3 jar are getting loaded.

Any difference between server "all" and "default" ?

Prashant
[ January 31, 2008: Message edited by: Prashant Vasudeo ]
16 years ago
in Jboss-app.xml
org.myapp:loader=MyAppClassLoader

what is "MyAppClassLoader"...Do I need to create my own classloader or its value will be "myear.ear" ?

Prashant
16 years ago
Hi All,

I am using Hibernate code 3.2.5GA and Annotations 3.3 with Jboss 4.0.3, which comes pre-packaged with Hibernate 3.1 jar.

I am facing classloading problem, as it takes 3.1 jar rather than 3.3 which is bundled in my .war file.

what i want that my application should use 3.3 jar packaged in my war file rather than from 3.1 jar

after reading these article...
http://wiki.jboss.org/wiki/Wiki.jsp?page=ClassLoadingConfiguration
http://java2.5341.com/msg/68204.html

I did following changes,

jboss-web.xml
--------------
<jboss-web>
<context-root>ABC</context-root>
<class-loading java2ClassLoadingCompliance="false">
<loader-repository>
aaaa.com:loader=ABC.war
<loader-repository-config>java2ParentDelegation=false</loader-repository-config>
</loader-repository>
</class-loading>
</jboss-web>

jboss-app.xml
--------------
<jboss-app>
<class-loading>
<loader-repository>aaaa.com:loader=ABC.ear</loader-repository>
</class-loading>
</jboss-app>

I am using following structure of my ear file
/
ABC.war
META-INF/
application.xml
jboss-app.xml

Also I don't have access to jboss-service.xml, as it is not for a particluar jboss instance but for firm wide usage, so i cannot change anything in this file.

Can anybody tell me what is wrong in it or any other way to work

Prashant

[ January 30, 2008: Message edited by: Prashant Vasudeo ]
[ January 30, 2008: Message edited by: Prashant Vasudeo ]
16 years ago
I have two arrays of two value objects

class VO1 {
String name;
String age;
//getter methods
//setter methods
}

class VO2 {
String name;
String age;
//getter methods
//setter methods
}

VO1[] objArry1 = VO1[10];
VO2[] objArry2 = VO2[20];

Assuming that both these arrays are populated, i am creating a third array of value objects by using these two arrays

ThirdVo[] objArry3 = ThirdVo[30];

For populating the thrird VO i am using for loop and getter methods of value object.
e.g
for (int i = 0; i<objArry1.length; i++) {
VO1 tempOBj = objArry1[i];

ThirdVo obj = new ThitdVo();
obj.setName(tempObj.getName());
obj.setAge(tempObj.getAge());

objArry3[i]= obj;

//for gc
objArry1[i] = null
}
//for gc
objArry1 = null; //as my objects are copied in ThirdVo and i don't want it further in the code

My Question
1.is the line after //for gc is really necessary
2.is it a good practice to make obj reference to explicitly to null

regards
prashant
objArry1[i] = nullobjArry1 = null;
19 years ago
Hi,

I started working on the assignment part for part-2
all the use case has security description as
"All interaction with the customer and the system must be secured with SSL."

I want to know how we can "inforce" the use of SSL (https)
1.to swing client (for FBN administrator..travel agents)
2.to web application for FBN.(for normal user)

( I know that in case of lets say weblogic, port 7002 by default runs for https)

regards
prashant
Hi all,

I have few doubts regarding part-2

1.what is mean ny segment..( there is itinerary--> segment 1..* reletionship)
is this mean that ....mum-bang-cal---1 segment
cal-bang-mum---2 segment

2.what is equipment (1 flight--> 1 equipment--> seats 1..*)
ex: is it means that 1 ticket has three seats

3.Prepare Itinerary use case
what is this following statements means :-
'System responds with the selected flight priced and alternative flights
if less than selected and within one hour of departure and return times"

post conditions
---------------
it could also contain city, flight number, date, time and seat number for each leg of
yhr flight if a lay over is necessary

4. Pay for itinerary use case
what is following statement means
system returns the list of credit cards on file. It only displays the last 4 digits
of credit card, expiration date and type, then customer selects the credit card

is this means that the customer will fee dthe credit card deatils, when he creates the profile.
i mean how can the systen can display the last 4 digits , exp date and type.

regards
prashant
I want to know ..how to go about part-2 in SCEA.
1.do i need to get the voucher for the same.(from where)
2.where to download the assignment.

thanks
hi
I am trying to use the nested tags in form bean . please help me on this.
I have a form which will have 8 element (textbox,radio box,...) in one row
and user have (add and delete buton) after the user clicks on + button one row should be displayed in the screen.
I tried this using nested tags.but giving some errors. also
It is possible that after user has entered the data the formbean will be populated with the user data?
please help as i have trying it for 3 days ..and i have to delivery on monday.
the code is as follows
Form Bean
------------
public class TestBean extends XmlCoeActionForm {
private MyBean myBean;
private String attb = "attribute";
public TestBean() {
Logger.writeDebug("creating TestBean.............");
this.myBean = new MyBean(this);
}
public MyBean getMyBean() {
Logger.writeDebug("getting MyBean.............");
return this.myBean;
}
public void setMyBean(MyBean mybean) {
Logger.writeDebug("setting MyBean.............");
this.myBean = mybean;
}
public String getAttb() {
Logger.writeDebug("getting arrb.............");
return this.attb;
}
public void setAttb(String attb) {
Logger.writeDebug("setting arrb.............");
this.attb = attb;
}
}
my MyBean class
----------------
public class MyBean {
private TestBean testbean;
private ArrayList myBeanList= new ArrayList();
private String newButton;

public MyBean(TestBean testBean) {
Logger.writeDebug("creating MyBean.........");
/* set the master bean */
this.testbean = testBean;
this.myBeanList = new ArrayList();
ActualBean bb = new ActualBean(this);
bb.setTxtLeftValue("leftvalue");
bb.setTxtRightValue("rightvalue");
this.myBeanList.add(bb);
}

public Object[] getMyBeanList() {
Logger.writeDebug("getting MyBeanList.........");
return this.myBeanList.toArray();
}

public void setMyBeanList(Object[] newMyBeanList) {
Logger.writeDebug("setting MyBeanList.........");
this.myBeanList = new ArrayList();
for (int i = 0; i < newMyBeanList.length; i++) {
this.myBeanList.add(newMyBeanList[i]);
}
}

public void setNewButton(String empty) {
Logger.writeDebug("setting NewButton.........");
ActualBean bb = new ActualBean(this);
bb.setTxtLeftValue("");
bb.setTxtRightValue("");
this.myBeanList.add(bb);
}


}
my ActualBEan class
----------------------
public class ActualBean {

private String txtLeftValue;
private String txtRightValue;
private MyBean myBean;
public ActualBean(MyBean myBean){
this.myBean = myBean;
}
/**
* @return
*/
public String getTxtLeftValue() {
return this.txtLeftValue;
}
/**
* @return
*/
public String getTxtRightValue() {
return this.txtRightValue;
}
/**
* @param string
*/
public void setTxtLeftValue(String txtLeftValue) {
this.txtLeftValue = txtLeftValue;
}
/**
* @param string
*/
public void setTxtRightValue(String txtLeftValue) {
this.txtRightValue = txtLeftValue;
}
}
my Jsp is
----------------
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-nested.tld" prefix="nested" %>
<%@page import="com.chase.xmlcoe.xmltoolkit.codegenerator.mappingservice.MyBean" %>
<%@page import="com.chase.xmlcoe.xmltoolkit.codegenerator.mappingservice.TestBean" %>

<html>
<form name="test" action="/xmlcoe/test.do" method="post">
<input type="hidden" name="actionKey" value="SUBMIT">

<jsp:useBean id="bean" class="com.chase.xmlcoe.xmltoolkit.codegenerator.mappingservice.TestBean"/>
<jsp:getProperty name="bean" property="myBean"/>
<% MyBean myBean = bean.getMyBean();
out.print("myBean is:"+myBean);
System.out.println("myBean is:"+myBean);
Object obj[] = myBean.getMyBeanList();
out.print("obj.length is:"+obj.length);
System.out.println("obj.length is:"+obj.length);
System.out.println("obj is:"+obj);
%>
<nested:nest property="myBean">
<nested:submit property="newButton" >NEW Button</nested:submit>
<nested:iterate property="myBeanList">
<nested:text property="txtLeftValue" />
<nested:text property="txtRightValue" />
</nested:iterate>
</nested:nest>
</form>
</html>
The error shoen is myBean is not found in any scope.
if i comment the iterator for myBeanList it shows the button generated
but if try to get values for txtLeftValue,txtrightValue , it is giving error.
regards
prashant
20 years ago
i used it successfully for avoiding multiple submits..
thanks
prashnat
21 years ago
hi,
i want to know how to implement these methods in struts in order to avoid multiple submits of a form.
can anybosy give one example>.
thanks
prashant
21 years ago
thanks for the same.

regards
prashant
21 years ago
I want to test that if i send a request to a servlet and the thread is taking more time than that of server grace period, in this case the web container will call the destroy() method for it.
I want to test this thing , that's why i put an infinite loop in doPut() , so that after i gave request to the servlet , it will go in loop and response will not come ..so that after server timeout the container will call its destroy() method.
After reading the tutorial, i want to test the gracefull exit for a servlet instance, I will send no. of requests and i will make changes the program so the the in doPut() , it will sleep more than that of server timeout, and check in the destroy() method, which will be called after server timeout, that all the threads have been processed the request by the servlet instance.
please let me know , do u want anymore desc.
thanks,
prashant
21 years ago
hi
i was trying to test the timeout period. for that i made a infinite loop.
if i remove the infinite loop , then yes..the destroy method is called after redepoyment.

Here is the wording of servlet tutorial.
"All of a servlet's service methods should be complete when a servlet is removed. The server tries to ensure this completion by calling the destroy method only after all service requests have returned or after a server-specific grace period, whichever comes first."
the page link is
http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/Servlets12.html
regards
prashant
21 years ago
hi
its not working it's goes in the loop but after redeploy...it never stops..
the code is as follows
package servlets;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServlet;
public class MyServlet extends HttpServlet
{
public void init()
{
System.out.println("inside init()");
}
public void doGet(HttpServletRequest req, HttpServletResponse res)
{
System.out.println("inside doGet()");
for (int i =0; ;i++ )
{
System.out.println("i is "+i);
}
}
public void destroy()
{
System.out.println("inside destroy()");
}
}

regards
prashant
21 years ago