Help coderanch get a
new server
by contributing to the fundraiser

Venkatesh Kumar

Ranch Hand
+ Follow
since Aug 08, 2003
Merit badge: grant badges
For More
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 Venkatesh Kumar


In JSF do we have something similar to Plugin interface in Struts where we can initialize resources,set values in context during application start -up.Thank you for your responses.

15 years ago
Hi All:

We are building an application using JSF,Hibernate,and EJB3 and would like to implement the best practices out there in our project.Following are some design related qts.

We have two screens Create Order and View Order.As the names indicate Create Order screen lets the user place an order and View Order screen lets the admin view the orders.View Order screen has some actions/functionality specific to the admin.Should we use the same backing bean for both the screens or separate it out by having a OrderBean,and extending OrderBean to have CreateOrderBean and EditOrderBean.???

Is it a good practice to use the ORM objects in the JSF pages directly?Would it lead to tight coupling b/w the UI layer the and the DB layer.(Scenario:When the admin searches for the orders we iterate through the order objects and display them in a table).

Thank you for your responses.
16 years ago
Hi Mark:

Thanks for your reply.I have many-to-many on both the sides.


I have a many-to-many mapping between entities course and student with many-to-many table named as student_course.Class student has a getter/setter for the collection of course(s) and vice versa.When I update student after removing a course from the collection(collection of courses) in class student,i see that the following queries are executed on student_course table:
(eg:a student had 3 courses and 1 course is removed from the collection)

delete from student_course where student_id =?
insert into student_course values(?,?)
insert into student_course values(?,?)

Why is there a deletion of all the records and then insertion of two records for the records that are remaining in the collection?Is there a way to delete only the record that was removed from the collection instead of deleting all the courses related to the student ?

Thanks for all your responses!!!

I am exploring the option of having autocomplete feature for a text field(username).
Scenario:Type username partially and select the user.On selecting the user his/her address should be populated.

Questions/Concerns regarding the above scenario:
1)There are around 15,000 users.Is it possible to have an autocomplete feature with the size of the data that we are dealing with?

Any ideas or solutions to handle the above mentioned scenario is greatly appreciated.Thank you all for your responses!!!

16 years ago
Hi Ulf:

Thank you for your response.All that I am trying to do is encrypt and decrypt and audio file.

16 years ago
Hi All:

Can we encrypt and decrypt audio using Java Sound/Media API?I have tried looking up for articles related to this topic but have not been lucky enough to get one.I would appreciate if anyone could shed more light regarding this topic.

16 years ago

I am a newbie to Hibernate and am getting the following exception when trying to run a sample pgm from the Hibernate tutorial.Can anyone pl let me know on how to resolve this exception.

[java] org.hibernate.LazyInitializationException: failed to lazily initiali
ze a collection of role: - no session or session was closed
[java] at org.hibernate.collection.AbstractPersistentCollection.throwLa
[java] at org.hibernate.collection.AbstractPersistentCollection.initial
[java] at
[java] at org.hibernate.collection.PersistentSet.isEmpty(PersistentSet.
[java] at EventManager.main(Unknown Source)
[java] Exception in thread "main"
[java] Java Result: 1
[echo] Executing

part of the code in my main():

mgr.addPersonToEvent(new Long(1), new Long(1));
mgr.addPersonToEvent(new Long(1), new Long(2));

List personList = mgr.listPersons();
for (int i = 0; i < personList.size(); i++)
Person person = (Person) personList.get(i);
Set eventSet = person.getEvents();
if (eventSet != null && !eventSet.isEmpty())
Iterator iter = eventSet.iterator();
while (iter.hasNext())
System.out.println("Event - " + ((Event);

private void addPersonToEvent(Long personId, Long eventId)
Session session = HibernateUtil.currentSession();
Transaction tx = session.beginTransaction();

Person aPerson = (Person) session.load(Person.class, personId);
Event anEvent = (Event) session.load(Event.class, eventId);

Hi All:

I a trying to create a XML file of size ranging from 50 - 200 MB.As I read the database and start building the XML Elements I get OutOfMemmoryError.

Can anyone shed some light on the cause of this error and a way to get around it ???

Hi James:

Thank you for your response.I am including j2ee.jar in the .ear file.

Thanks ,
19 years ago
Hi All:

I am get the following error when I deply the EAR file in JBOSS 4 application server .

- jar not loaded. See
Servlet Spec 2.3, section 9.7.2. Offending class:

I am using struts 1.2.4 as the application framework.When I access the application ,I get an exception --not able to instantiate the formBean.Can anyone pl guide me on resolving this error.

19 years ago
Hi All:

I have a jsp page created which has tabbed menus .I am using Struts-Menu .
As soon as the user logs into the application the user sees the tabs on all the jsp pages that the user naviagetes..

To have the tabs on all the jsp pages ,do I need to create a jsp page with just the tabs and include them in all the jsp pages of the application which means lot of code duplication OR do I need to use some templates for all the jsp pages like Struts Tiles.

Currently I have the path provided to different jsp pages in the "page" attribute of the "Menu" tag .Is it possible to trigger an action handler by clicking on the tabs ???

Also,can anyone guide to me the struts-menu documentation.??

What are the alternatives to Struts-Menu ???

Thanks ,
19 years ago

Thank you for all your responses .
19 years ago
Hi All:

I am trying to build a simple struts application.I have a login.jsp and a main.jsp.I just have coded only the formbeans and actions.

How I can avoid direct access to main.jsp???Currently the user can access main.jsp by typing http://..../main.jsp or any other jsp pages other than the login.jsp ...

19 years ago
Hi All:

I am trying to create a jsp page with tabbed menu,and I get the following exception when i try to acces the jsp page with the menu.I cann see the menu items but they are not in the tabbed fashion.Plese some one help in resolving the following exception

Part of the exception:

arse Error at line 33 column 57: Element type "plug-in" must be declared.
org.xml.sax.SAXParseException: Element type "plug-in" must be declared.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(

Parse Error at line 38 column 17: The content of element type "struts-config" must match "(data-sources?,form-beans?,global-forwards?,action-mappings?)".
org.xml.sax.SAXParseException: The content of element type "struts-config" must match "(data-sources?,form-beans?,global-forwards?,action-mappings?)".

My struts -config looks like:

<form-bean name="nameForm" type="com.actek.actionform.NameForm"/>

<forward name="success" path="/main.jsp"/>

<!-- Save user registration -->
<action path="/setName"

<plug-in className="">
<set-property property="menuConfig" value="/WEB-INF/menu-config.xml" />

My menu-congig.xml looks like


<Displayer name="TabbedMenu"

<!-- New Menu for Tabbed Displayer -->
<Menu name="TabbedHome" title="Home" location="?Home" target="_blank"/>
<Menu name="TabbedAbout" title="About"> <!-- No location, uses first item's location (People) -->
<Item name="People" title="People" location="?People"/>
<Item name="Careers" title="Careers" location="?Careers" target="_blank"/>

<Item name="Locations" title="Locations" location="?Locations"/>

<Menu name="TabbedContact" title="Contact" location="?Contact">
<Item name="EMail" title="E-Mail" location="?EMail"/>
<Item name="Phone" title="Phone" location="?Phone"/>
<Item name="CarrierPigeon" title="Carrier Pigeon" location="?Pigeon"/>
<Menu name="TabbedExit" title="Exit" page="/login.jsp"/>

19 years ago