Win a copy of Head First Android this week in the Android forum!

Sri Basavanahally

Ranch Hand
+ Follow
since Oct 07, 2003
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 Sri Basavanahally

Hello All,

I have several singleton objects in my web application. I use these to cache Data from a database at application startup time. The problem with this design is that if the data changes (which is not too frequent), my application has to be "restarted" manually.

Has anyone used something like JMX to automate this process ? OR any other method, that will update the singletons based on a change in data and keep it transparent to the user.

Thanks !

-Sri
Thank you.

I am thinking of collecting the selected values(including text fields, checkboxes, radio buttons, etc) in a bean( I am using Struts) and placing the bean in request scope after the first form submit. I can use these values in the JSP to pre-popluate the form when it gets displayed the second time.

Is there an easier way ? :-) I will look into JSTL and EL.
16 years ago
JSP
Thanks Ben ! I guess it works the same, then.

Now, you do some logic in the back-end to keep the drop down item the user selected to be selected when the page comes back.

So, if I have other form input text fields, checkboxes and what not, that the user has entered, before I send the request to the server to populate the second drop-down, I guess I have to send them back as well, so that the form does not get "reset". Am I right ?
16 years ago
JSP
Ben,

You use two different forms to do this. I have a case where the drop downs in question are part of one big form. How do I handle such a case ?

Thanks for your help !

-Sri
16 years ago
JSP
Hello Mary !
the following shows how to unzip the a zip file, get the file names etc. It will help you.the classes you need are in java.util.zip.*;
when you get the zip file from the DB,create a zip file as follows:
ZipFile zipfile = new Zipfile(filename);
then: get the entries in the zip file:
Enumeration entries = zipfile.entries();
then you can go through all of them
while(entries.hasMoreElements())
{
//get the entry
ZipEntry entry = (ZipEntry)entries.nextElement();
//get file name
String name = entry.getName();

//parse the name
if(name.substring(..)){}
//OR
StringTokenizer st = new StringTokenizer(name,".");
----- so on-----
}//end while
Hope that helps

-Sri
17 years ago
Since I did not find Jetty in it, I downloaded Jetty, but I am not sure how to integrate it ith JBOSS> I have to create a .sar, I guess and put it in the default/deploy dir ?
Does anyone know ?
17 years ago
I am new to JBOSS. I downloaded v3.2.2 and cannot find Jetty. Is it packaged with JBOSS 3.2.2 ?
-Sri
17 years ago
Bill,
I figured out the problem !
I had to remove this from server.xml, that I had previously added:
<Context path="/Prep" docBase="Prep" debug="0" reloadable="true" />
Do you know why I had to do this? Note that, If I run the app in the regular fashion i.e without the WAR, the above can be in server.xml:
-Sri
17 years ago
The tomcat version is 4.1.24
The JDK is 1.4.
-Sri
17 years ago
Hi Bill,
1. Yes, unpackWARS is set to TRUE.
2. I dont have the Prep directory in there.
3. I DO have the WEB-INF dir and web.xml file in the WAR,
So, I am not sure what is going on...
-Sri
17 years ago
First off,
I did a search in the tomcat forum for this problem, although a similar question has been posed by someone, no answer has been given. May be someone can help here...
I have a WAR file which I created by running the jar command as follows:
jar cvf Prep.WAR .
I ran this command from within the Prep directory.
I placed the resulting WAR file in webapps and started tomcat. Two things:
1. Prep.war is not getting expanded - I have other WARs that do expand.
2. I have a login.jsp in the app and I am running it as:
http://localhost:8080/Prep/login.jsp
and I get a resource not found error.
What am I doing wrong here ? I can run the app fine in an unpackaged fashion.
Any help is greatly appreciated. Thanks !
Regards,
Sri
17 years ago
Prakash,
You can do this by sending the credit card information to the business methods in you bean. The create method creates the bean instance and returns a reference, which you can use to call business methods.
So I could have a method public boolean validate(cc number, exp date..), etc which does the job for you. This would be declared in the remote interface and implemented in the bean class.
Does that help ?
-Sri
I am not sure what the "big picture" here is, in other words may be there is a better way to do what you are doing. But, in general a servlet responds only to a client request on the web.
Is this a web application ?
-Sri
17 years ago
If you have a reference to ServletConfig in your class, you can use it to get the ServletContext.
18 years ago
Sorry, I misspoke about prepared statements. Ignore it. Just make sure you have gotten those values from your form into the servlet for starters.
18 years ago