Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!

Sweta Chauhan

Ranch Hand
+ Follow
since Jul 09, 2010
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
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Sweta Chauhan

Hi All,

I am new to Synchronization interface for javax.transaction and there is requirement in my project where I need to use Synchronization interface.I tried to search for example but not able to find full example how to use this class.I have to call beforeCompletion() and afterCompletion(int arg0) method to post messages to kafka queue before and after transaction completion.Please suggest me how could I use synchronization interface and any example will be helpful.
3 years ago
Hi,

I am new to struts2 and I am trying to use session with SessionAware class option in my action class.

In struts.xml file package is set as json-default. But when try to get value from session then null object is returned. I am not very sure the issue is because I am using package json-default that is the or something else. Could you please help me someone if I am missing any thing..

Also wants to know what is difference between package struts-default and json-default.

Regards
Shanta
6 years ago

Stephan van Hulst wrote:This seems like a really weird requirement though.

Why should the threads wait for each other? They're not bothering each other by reading concurrently. And if they have to read one at a time, why is this multi-threaded in the first place?



Thanks Stephan for your response.

You are right I think we need to reconsider the requirement.
6 years ago
Hi,

I have worked on java but not in multithreading issue. Currently in my organization there is requirement where file will be read by multiple thread and need to ensure that first thread t3,t2 and t1 will read the file and after that rest of thread could start reading.

I am able to achieve the first scenario with join() method but when thread t4,t5 and t6 start reading file result in not what is expected. for example T4 is not finished with synchronized readFile() method and t5 start executing synchronized readFile() method.

I am sharing my code, could someone help where I am missing.

6 years ago
Hi All,

I am using struts2 and json gridview in my project. I am able to display the list data in gridview but while try to call json action from sj:a href tag or sj:submit option gridview in not displayed, instead it display the json data in browser.

{"JSON":"success","gridModel":[{"progId":1,"programName":"BASE","projectNames":null,"updateDate":"2012-04-12T22:08:12","updatedBy":null},{"progId":2,"programName":"BASE1" }



.jsp page


stuts.xml





Kidly help to how to display the gridview when I click the submit button.

I have tried different method but no luck.

Thanks in advance..
10 years ago
I am having a requirement to call a Action class as soon as application is started. I have used this is struts1.3 but not able to find how to do this in struts2. Could anyone give me any help on how to do this.
11 years ago

Joe Ess wrote:You would invoke it the same way you would invoke any URL. If you just need some information and don't want to reload the page, use the AJAX-style XMLHttpRequest (your action should return XML or JSON). If you want to reload the page, use window.location.



Could you please give me any detail on how to return JSON result.
11 years ago
I want to call Struts2 action from javascript function. I have searched Google but not able to find any hints to how to do. If anyone have worked on this then please give me any hints.
11 years ago

Ankit Garg wrote:When does the error appear actually?? If it occurs when you enter a URL into the browser, then tell us that URL otherwise if it happens when you submit a form, then please post the code of that form. I think the error appears when you try to list all students as validation happens in that case and since there is no "input" result defined, you get the 404 error message. You'll have to tell struts to skip validation in case of StudentAction.list() method. You can find more info on how to do that here...



Thanks by use of interceptor for list action it work perfectly.
11 years ago
Student.java

11 years ago

Ankit Garg wrote:Its hard to guess what the problem is without some more code. Does your action returns "input" result in any way or is there any validation error when you reach this action??




All files are given below:
struts.xml


viewStudent.jsp



StudentAction.java


StudentAction-validation.xml


11 years ago
I am trying to display list of data from database in struts2, I have defined the success result but when try to call the action it throw error

I don't have requirement for input result. Any one have faced this kind of problem then please help me out. Why is it so?
Below is the action mapping in struts.xml file

11 years ago
Hi have a form in which I am generating list of input box dynamically, but I am having the problem when I try to use date value of date picker within the form as hidden a field within the same form.

my jsp page is given below.


I have try to search the solution for the problem but not getting any idea.
11 years ago

Lester Burnham wrote:Where does the data come from? Is it in a database already? Or does each employee need to log into the application you're writing to enter their own data?



Sorry for late reply, all employee data will be coming from the Oracle10g data.
11 years ago
JSP
Hi,
I am working on a project which require to create attendance sheet of all employee within the organisation for each month. I am trying to create a attendance sheet using java.util.Calander class. But not getting the the idea of how to generate sheet dynamically for each month. Could any body give any idea how to start or any other alternate option.
11 years ago
JSP