This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Svelte and Sapper in Action and have Mark Volkmann on-line!
See this thread for details.
Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!

Raj Chukka

Greenhorn
+ Follow
since Apr 09, 2007
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 Raj Chukka

Hi,

My requirement was to execute a batch job on 2nd SUNDAY and 4th SUNDAY

Is the following expression is correct for DAY_OF_WEEK to achieve the same?
7#2-7#4

Thanks - Raj
9 years ago
Hi Paul,

Thanks for the reply. I am new to XSLT.

<xsl:template match="/">
<xsl:for-each select="TopElement/SubElement">
<xsl:if test="data[@name='id1']" >
<xsl:value-of select ="data" />
</xsl:if>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>

I am not able to print the output for "id1" which is "1" the XSL? Can you please correct me where I am doing wrong?

Thanks,
Raj
Hi,

I am trying to generate csv file after concatenating some of the fields in XML

My XML:

<TopElement>
<subelement>
<data id="id1">1</data>
<data id="id2">1</data>
<data id="id3">3</data>
<data id="id4">4</data>
</subelement>
</TopElement>

I want to concatenate id1, id2, id4 like 1,1,4 (csv) format.

Can you please help me by with XSL?

Appreciate your help

Thanks
Raj
Can you please check whether you are removing the object from the application context by any change in the application?

Otherwise no. it will never be removed

Thanks,
Raj
10 years ago
Hi,

I have 3 actions (Buttons) in my screen. I have a requirement that we still need to send the request to Action class even after Javascript is disabled

Currently i am doing the following

<html:form method="post" action="a.do">



<%-- Now i have 2 more Buttons --%>
<html:reset value="Reset" ..... onclick = "javascript:clear(form) "/>
<html:submit value="Submit" ..... onclick = "javascript:submitAction()"/>
</html:form>

if the JavaScript is disabled, both the buttons will not work. I want to send them in "action" attribute it self. How do i do that? Can someone help me?

Thanks,
Raj
10 years ago
Hi,

I have purchased SCWCD voucher and its last date is 31st December 2008. I could not take up the exam last year. I did register it with prometric and after sometime cancelled it.

Today when i try to register, i see voucher expired message.

I tried to reach Sun Educational services and they are closed for Holiday season and sent a mail to them about the same.

Wanted to know whether they consider my case provide some relief in this case (the amount is $200).

Thanks,
Raj
Hi,

I have JDK 1.3.1 on Unix and (JDK 1.4.2) on windows. I have build.xml file which should take the different JDK's based on the OS. I got the following solutions for it.

1. Declare <property> in ant script like below and change it accodingly.

<property name="java.home" value="JDK_HOME_PATH"/>

2. I create a properties file for each env like below.

in unix:
<property file="jdk_unix.properties"/>

in windows
<property file="jdk_windows.properties"/>

whenever i run the build.xml, i will comment the other properties file.

is there any other way i can do this without any modifications on the build file?

Thanks in advance.

Thanks,
Raj Chukka
11 years ago
Hi ,

iam defining one derived propery in Emp.hbm.xml like below.

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"; >

<hibernate-mapping package="events">
<class name="Emp" table="EMP">
<meta attribute="sync-DAO">false</meta>
<id name="empno" type="int" column="EMPNO">
<generator class="native">
<!-- <param name="sequence">emp_sequence</param> -->
</generator>
</id>
<property name="ename" type="string" column="ENAME"/>
<property name="job" type="string" column="JOB"/>
<property name="mgr" type="int" column="MGR"/>
<property name="hiredate" type="timestamp" column="HIREDATE"/>
<property name="sal" type="double" column="SAL"/>
<property name="comm" type="double" column="COMM"/>
<property name="deptno" type="int" column="DEPTNO" insert="false" update="false" />

<property name="empderived" type="string" formula="select sum(e.sal+e.comm) from Emp e where e.ename = ename" />

<many-to-one name="dept" class="Dept" column="DEPTNO"/>

</class>
</hibernate-mapping>

Here is the code snippet iam using to access the Emp object.

Session session = m.getSession();
Transaction txn = session.beginTransaction();
Emp list = (Emp) session.load(Emp.class, 7782);
System.out.println(list.getEmpderived());

Iam getting the following exception:

Exception in thread "main" org.hibernate.exception.SQLGrammarException: could not load an entity: [events.Emp#7782]

can someone correct me where iam going wrong?

Thanks in advance.

Thanks,
Raj
Hi,

I got a question from an interviewer.

1. What will happen if a RuntimeException occurs in onMessage() method of MDB.
2. Also in a queue if the first message is corrupted, how to retrieve the next messages.

Can someone answer this?

Thanks in advance.

Thanks,
Raj
Hi,

Can i select checkbox property as String something like below.

<html:checkbox name="FormBean1" property="prop1" value="Y">

Is there any issue in selecting string type for checkbox?

Thanks,
Raj Chukka
12 years ago
Hi,

I got two action classes (say A1 and A2) and two form beans (F1 and F2).
Iam populating F2 in A1 and transferring the control to A2 (which has mapping to F2). But iam getting all "null" values.

How should i retain the values in form F2 when switching the class???

struts-config.xml is listed below.

<action path="/A1.do" name="F1" scope="session" type="A1">
<forward name="OK" path="/A2.do" redirect="true"/>
</action>

<action path="/A2.do" name="F2" scope="session" type="A2">
<forward name="Success" path="/success.jsp/>
</action>

Thanks in advance.

Thanks,
Raj Chukka
12 years ago
Thanks Merrill.

Though i have collection (arraylist) still iam using the strings inside the DTO.

Iam posting the classes again.

public class DetailFormBean {

ArrayList tempList1; // collection of list objects (dto's)

}

public class DisplayDto {

String strName1; // read/write
String strName2; // read/write
ArrayList tempList2; // collection of inner list (dtos).
}

public class DisplayDto1 {

String s1; // read-only
String s2; // read-only
String s3; // read-only
}

In the JSP iam rendering the page like below.


<logic:notEmpty name="DetailFormBean "
property="tempList1">
<logic:iterate id="list1"
name="DetailFormBean "
property="tempList1"
type="DisplayDto"
indexId="index1">

....


<logic:iterate id="list2"
name="list1"
property="tempList2"
type="DisplayDto"
indexId="index2">

....

</logic:iterate>
</logic:iterate>
</logic:notEmpty>

If i have to do indexing how should i do it here?

Thanks in advance.

Thanks,
raj chukka
12 years ago
Hi
iam getting the following exception when iam checking the "checkbox" click event.

[5/9/08 11:47:53:047 EDT] 7cbab2f0 WebGroup E SRVE0026E: [Servlet Error]-[BeanUtils.populate]: java.lang.IllegalArgumentException: argument type mismatch
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))
at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
at org.apache.commons.beanutils.PropertyUtils.setSimpleProperty(PropertyUtils.java:1789)
at org.apache.commons.beanutils.PropertyUtils.setNestedProperty(PropertyUtils.java:1684)
at org.apache.commons.beanutils.PropertyUtils.setProperty(PropertyUtils.java:1713)
at org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:1019)
at org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:808)
at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1252)
at org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:821)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:254)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:983)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:564)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:200)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:119)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:276)
at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:182)
at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:618)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:439)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:672)


iam using a form bean which has an arraylist (collection of DTOs) because i need to display a list and that "DTO" has one more arraylist (i need to display list inside list) inside.

Can someone exlain me why iam getting this issue? Is it legal to use like this?

Thanks,
Rajendra
12 years ago
Hi,

In FormBean i have a List of DTO objects and in DTO i have 2 indexed properties.

In DTO, iam using non-indexed properties and indexed properties in my DTO like below.

private String a;
private String b;
private String c[] = new String[10];
private String d[] = new String[10];


public void setC(int index, String string) {
a[index] = string;
}

public void setD(int index, String string) {
b[index] = string;
}

------------------------------------------------------
A | B | C1 | D1
C2 D2
C3 D3
------------------------------------------------------

I have to display the records in the above format.


Can someone tell me how to do this (this is nested indexed property).
Thanks,
Raj Chukka

[ May 01, 2008: Message edited by: Raj Chukka ]
[ May 01, 2008: Message edited by: Raj Chukka ]
12 years ago
Hi,

We are developing struts based web application. Iam getting the results from database and populating the list on the screen using dto objects.

<logic:iterate id="list"
name="DetailDto"
property="listdata"
type="examples.ListDataDto"
indexId="index1">
<%-- it has 5 columns --%>
</logic:iterate>

iam able to populate the data correctly and its working fine. I want to add one row at the end dynamically with the first column to be set as a text box.

How do i do that? Can someone help me in this?

Thanks,
Raj Chukka
12 years ago