lalit upadheyay

Ranch Hand
+ Follow
since Jun 20, 2005
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 lalit upadheyay

For entity beans, isIdentical() returns True if the stubs refer to two entities with the same primary key.

Is it possible to have two entitites withe the same primary key in the same jvm/heap ?


Thanks Dejan Mratinkovic. Yes, simplicity is the key. I was searching using more technical terms.
I googled for transaction isolation levels. I came to know of the fact that Nonrepeatable read and Phantom read problems can occur when transaction isolation level is
READ_COMMITTED. I thought and searched around this but couldn't find satisfactory explanation. Can someone please explain by giving some example ?
A global forward is defined in a Struts configuration file and invoked in a JSP page. A local forward is defined in a Struts configuration file in an action mapping and is invoked when the action is invoked.

Following is an example of global forwards in the struts-config.xml file of the struts-example sample application:



The logoff forward is invoked in mainMenu.jsp as follows:
test.jsp:
<html:link forward="logoff"><bean:message key="mainMenu.logoff"/></html:link>

Another example for global forward is:


index.jsp:
<logic:forward name="init"/>

Note: we can get a reference to global and local forward in an action using actionmapping.findforwsrd(String) method.
8 years ago
Thanks David.

This is trivial to verify by simply logging action creations.


Should I create public constructor of my action and write log statements in it for this ?

ActionForms are only re-used if they're session-scoped, otherwise there's an instance created per request.



What if I have action mappings modified as :


Still will the same instance of CustomerForm be used for serving both the requests ?

Just want to resolve the puzzle around singleton behaviour of action instances. If they are truely singleton or not ?
8 years ago
That's true. As the struts controller (ActionServlet is actually a servlet) and it tries to re-use instances of existing components (actionforms, action classes etc). Keeping this in mind, just want to know how many action instances will be craeted if we have mupltiple action mappings for the same action (mywebapp.actions.ManageCustomerAction) ?
How many action form instances will be created if we have multiple action form mappings for the same action form(mywebapp.forms.CustomerForm) ?
8 years ago
Hi All,

Supoose I have action mappings defined in struts-config.xml as:



If I add a cutomer via /addCustomer.jsp and then update that customer via /editCustomer.jsp, how many instances of actionForm, action, actionmappings will be created ?

8 years ago
Anyone interested in sharing a chunk of knowledge in this domain ?
Hi John,

Thanks for highlighting the useful infnormtaion from core specs and providing reference to confirm that JSPs and helper classes as non-managed.

Inspired by succesful EJB DI in JSP in the posting http://www.coderanch.com/t/414899/EJB-Other-Java-E...a/Glassfish-EJB-web-client-EJB , I am very much keen to see it working. But despite lots n lots of attempts getting failures.

In this posting the author(Raf Szczypiorski) was finally succesful in injecting EJB in a JSP using GlassFish server. I am unable to find out the missing link in my repeated efforts to see it working. Also sent a private message to the author but didn't hear back anything.

Once again thanks for replying and sharing the information.
Given the fact: Since EJB 2.1, MDBs may implement a messaging system other than JMS , I want to understand following:
1. What is non-JMS messaging ?
2. Can anyone provide me a url for a non-JMS messaging example ?

What happens when you try to access the di_foo_test.jsp directly instead of going through index.html?



If I try to access the di_foo_test.jsp directly by specifying url as http://localhost:8080/foowebapp/di_foo_test.jsp?msg=hello , still I get the same error messages (java.lang.NullPointerException) in response.

which exact version of Glassfish do you use?


How do I check the exact version of glassfish ? I looked at the console after bringing up the server and clicking the version tab in glassfish admin console. From that I concluded that I am using Sun Java System Application Server 9.1_02 (build b04-fcs). I installed glassfish via glassfish-installer-v2ur2-b04-windows.jar. I am using JDK1.5.0.11 .

Are you sure that, that version supports injection in JSP?


Not sure. But DI does work in a Servlet. I have verified that myself. The post url which I mentioned does not mention the version of glassfish used .
May I request the mdoerator to please move this posting to SCBCD forum where it might attract attention and get some response. I don't want to craete a duplicate Posting for the same.
Provided the POJO is deployed in EJB server and has EJB classes packages in same jar containing the POJO. Yes, EJB injection into a POJO is possible via Application Client Container(ACC) provided by the EJB server. Not all EJB servers support ACC. But GlassFish and JBoss serevrs provide ACC.
If using GlassFish, then you can use following for setting classpath in windows:

%GLASSFISH_HOME%/lib/javaee.jar;%GLASSFISH_HOME%/lib/appserv-rt.jar;

Ok. I was under impression that you have a separate code branch in CVS for different version of code and tagging is in place for the branches. So anytime you could have reverted to any of the existing versions with correct proeprty file in place.

BTW, how are you maintaing db version info in database ?
Are you just updating the same single row for upcoming versions ?
By db changes do you mean the schema enhancements ?