Souvvik Basu

Ranch Hand
+ Follow
since Apr 05, 2010
Souvvik likes ...
Java
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
3
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Souvvik Basu

I'm writing a Spring MVC web application. But my request is not reaching the controller class.
Here are the relevant files.
Can anyone please help me by pointing out where I am going wrong? Thanks...

web.xml




dispatcher-servlet.xml




applicationContext.xml




My controller class



index.jsp



login.jsp




I'm developing in eclipse, and using Tomcat. the server log has no errors. Just the standard start-up log.

Please help me to point out where I am going wrong.
5 years ago
As a reply to Scott....and to kind of re-open the discussion
I just got into a project that is developing an application using ATG framework. So looks like yes, people are still using it.

Now my question is....what are the prospects of this framework? I understand Oracle bought ATG sometime in 2011. Has ATG become more popular since then? How widely is it being used today?

Any inputs and thoughts would be of great help. I'm anxious about whether I am kind of screwing up my career by joining this project.

Thanks in advance for your valuable time and input guys
Hi Heena....thanks a lot for the response and the linked posts.

It solves my doubt
Hello All,

I was reading the SCJP 6 Exam Guide, and came across this question on serialization. The answer and explanation is not very clear to me. It would be really helpful if anyone can please explain it to me.



When this program runs, it prints pcp.

This means, the constructor for Player class runs even while de-serialization. My doubt is, when does it run the second time? If the CardPlayer object is being re-created through de-serialization, then obviously its constructor won't run. And in that case, the call to super() should also not take place.

Can anyone kindly explain where I am going wrong?
Hello Friends...can anyone please help me with this requirement?

In my application (Struts 1.3), I have a database table that stores multiple choice questions. Each row of the table is a question and is uniquely identified by a question ID. Each of these questions may or may not be associated to a test.

Now, I need to create a functionality whereby a user can associate one or more unassociated question to the available tests. There needs to be a jsp page displaying all unassociated questions. Beside each question, there will be a drop-down field with all available tests. The user can select the test for each question, and then select all questions he/she wants to associate (maybe via a checkbox) and then submit the entire page. I have 2 specific questions :

1) Since the number of questions on the jsp page will keep varying, how do I generate a multibox system with dynamic number of options, and each option has its own value property (which will also be dynamic)

2) Each of the multibox options will have atleast a question ID and a test name. When submitting, how can I have both these values submitted for each checkbox selected.

Any help or pointer will be really helpful. If there is any better way to achieve this requirement, kindly suggest.

Thanks...
6 years ago
I am creating an online exam application, and I am stuck with a validation issue.

I have a link on a jsp page adminHomePage.jspwhich calls an action that retrieves all Tests and all Users present in the database. The form bean being used is TestsNStudentsInfoForm. On success, the list of tests and students are being displayed on a new jsp testRegistration.jsp in drop-down fields. On this new jsp, I am using Struts validation framework to validate for empty fields. The testRegistration.jsp page uses its own form bean TestRegistrationForm to carry the workflow forward. However, the validation method is giving an error


When I convert the TestsNStudentsInfoForm bean from request to session scope, the error is rectified.

Now, my question is, why does the framework look at the bean whose use is already over, and which is not being used at all for the current workflow? Also, as long as the fields are not empty, and the code to add an ActionMessage to the ActionError object is not being executed, it is working fine. Looks like the framework is searching for the old bean before adding an action error, but not otherwise.

Here are my codes

adminHomePage.jsp


On clicking the link Allow a Student for a Test the /retrieveTestsNStudents path is followed. the struts-config.jsp for this mapping is


The data is being pulled correctly and displayed correctly on testRegistration.jsp.
testRegistartion.jsp


On clicking the submit button, the following mapping is invoked

The TestRegistrationForm bean is this


My apologies for the long post, but the issue seems to be tied to 2 actions, so I gave both the flows.
6 years ago
Thanks Ayan. That was a silly overlook on my part.
6 years ago
Thanks Ayan. That was a silly overlook on my part.
6 years ago
I have an ArrayList of user-defined objects that I need displayed on a jsp page. The arraylist has been populated from the database, and I have also set the arraylist property of the form bean in my Action class. These are my codes :

Action Class


Formbean


The jsp page



The print statements I have used in the Action class are confirming that the notices are being pulled properly. But when I execute this, I get the following error :


It looks like the <bean:message/> tag is searching for the message in the applicationresources.properties file instead of iterating over the arraylist.

Can anyone please help me figure out what I have done wrong?
Thanks....
6 years ago
No...my business logic doesn't require that there be 7 objects. I meant...there are currently 7 users there. It should be dynamic, increasing or reducing with time as users are added to/removed from the system.
6 years ago
Hi Jeff,
Thanks. That worked. The problem is...the if(rs.next()) code block in the retrieveAllUsers() method is finding only 1 result. There should ideally be 7 values in the resultset, not 1. So after retrieving that, it is returning the result back to the action class, which is then trying the get(). This is what made me think that there is some error with the add() function.
6 years ago
Also, Mansukhdeep.....I see the API for ArrayList.add method that I'm using is


I have made the ArrayList for only strings, and an arraylist need not be initialized with a specific size before using it, so I've not given it a size.

If the error is somewhere in the Action class's execute() method, then why do the


statements print all the users retrieved by the resultset? If issue is in action class, then atleast this code block should have executed completely and correctly, right?
6 years ago
Hi Mansukhdeep...the only place I am trying to access the ArrayList is when I am trying to add an entry. The very first time I'm trying to do it there's the exception. As the code shows, the ArrayList ought to be empty before the first time this add is attempted.

Hi Jeff...I'm not sure what other information I can give to make things clearer without introducing unnecessary details. But I'll try.

The quantinst.user table has a list of all users in the system (currently 7 in all). The different print statements give the following output :



The Action class from where this is being called is as follows :

The first print statement here is also getting printed as expected. But the last print statement, which ought to print the entire list, is not getting printed. this looks okay to me, as the exception is being thrown before this, and the execution never reaches this line.

Two other things.
1. While running the application, when I am encountering the error, I am getting an HTTP Status 500 error on the browser.
2. I am running this application from inside the Netbeans 7.0 IDE and the associated container is Glassfish Server 3.1

If there is any other information you think I missed out, please let me know.
6 years ago
I hope this is the correct forum to post this doubt. I'm getting stuck inside a model class in my Struts 1 web application, but the error appears plain Java related, so I'm posting here.

Ok...so I have a method as given below :



When this code is getting executed, I am getting the exception :



Following the different print statements, I can see that the size of the arraylist userList is 0, and hence userList.add() is throwing this exception.

Can anyone please point out what is it that I am doing wrong?
Thanks.....
6 years ago
Hi Lalit....thanks a lot for your post. The tag you named, is it a struts 2 tag? I followed your link and the documentation looks like its for struts 2 (also..the s prefix)
I'm using Struts 1.x for this. Any equivalent in 1.x version for this?
6 years ago