Help coderanch get a
new server
by contributing to the fundraiser

Jaimesh M Ponkia

+ Follow
since Nov 24, 2010
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 Jaimesh M Ponkia

You the setInterval method of window obj to set the refersh interval and the javascript function which should be invoked on refresh. In the javascript function, update the div content. Something like this should work:

In your case, if the request is inserting some data and you want to prevent duplicate insertion then implement the validate method in your action form and verify if the data is already present in the db.
13 years ago
Please verify which jar does the class belong to. You can do Ctrl+Shift+T in Eclipse and type in the class name, it will display the jar it belongs to. Verify that the jar is present in the java build path in your Eclipse.

Right click on the project, Go to Properties -> Java Build Path -> Libraries.
13 years ago
If you are using a tag lib to display the text box, then have a list which would hold the property of the text box and iterate through the list to display the text box.
13 years ago
Put the resource file in your java source folder so that it gets copied everytime a build happens.

Also, verify if the resource file is getting copied correctly to the deployment folder in your workspace.

13 years ago

vanlalhmangaiha khiangte wrote:

pramod talekar wrote:Hello,

Could you please tell me where to place struts.xml file in Eclipse.


This is the default location in Eclipse .. When you create a new project "dynamic web project" ..
There is no need for a separate init-param in web.xml ..

Moreover in your web.xml

If you use a configuration like the above in your code .. you can place your struts.xml anywhere in your project ...


How will struts know what is the name of your configuration file and where is it placed unless you specify it somewhere?
13 years ago

vanlalhmangaiha khiangte wrote:Hi pramod ,

In your eclipse , struts.xml and web.xml should be in the following location

Java Resource src
|--- struts.xml (under src folder)
Web Content
|--- WEB-INF |--- web.xml (under WEB-INF folder)



How would you specify the sturts.xml file path in web.xml if its in the src folder? As far as I know, the web.xml would be able to identify content that is placed within the WebContent folder and nothing outside that.
13 years ago
Yes. Your web.xml should have the configuration as follows:

13 years ago
Make sure you have the following checks done before you run the project:

1. All the class files in source folder and the same has been configured in the build properties.
2. JSP pages in WebContent folder
3. web.xml file in WEB-INF root
4. struts-config.xml anywhere in WEB-INF folder.
5. Configure the path for struts-config.xml in web.xml
6. Welcome file in web.xml
13 years ago
For a web project, you can keep your config file in WEB-INF folder and configure the same in web.xml file.
13 years ago
There is no need to use iterator for the drop down list that you are displaying.

Something like this should work for you:

13 years ago
No need to use for loop in jsp when you have the values in the bean property.

Have a look at the code below:

13 years ago
I am not sure if I understand the problem correctly, let me try to rephrase it.
1. You are currently on page which has URL as "/aaa/bbb/ccc/"
2. On click of a button or link you want to forward it some other URL/Action.

If this is the case then yes you can do it using struts. You can use ForwardAction for the same.

Just wondering why are you worried about what is the current page URL?
13 years ago
You can use Ajax to insert the record to database and return true/false based on the insert status.

Other way is to keep a variable in your bean class and set it based on the result of the insert status and once the same jsp is reloaded, call a method on load of the page where in you can check the status of that hidden variable and display alert and clear out the fields. This is the same method which you described in your post.

These are the only 2 ways that come to mind right now.
13 years ago

eddy johns wrote:Hi Ankit, thanks for writing back. So there's absolutely no way to pass objects? Not even on the request or the session?


If you are looking to avoid database call then there are few ways to do so:
1. Implement caching mechanism in your application, where in during the first database call you can store the result in a map and next time using the key you can fetch the object back from the map.
2. If you are fine using the session object, then you can put the result from the first database call into session and later during the second submit, use the key to fetch the value back from the session object.
13 years ago