Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!

Adi Kulkarni

Ranch Hand
+ Follow
since Mar 12, 2009
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 Adi Kulkarni

Thanks for the inputs Maneesh. I try to start with it.
7 years ago
Hello all,

I am relatively new to swings and need some direction in a simple application which I'm planning to write.

I have attached basic layout. I would like to know the components which can be used to start with. Any other help/leads to documentation would be appreciated.

Thanks,
Aditya
7 years ago
Thanks a lot Bear,

I noticed that our url has some blank spaces.

Example


response.sendRedirect("confirmation.jsp?a=<variable1>&b=<variable2> &c=<variable3>")


Will this blank page cause issues. Also from the log trace that we have got, the sendRedirect is getting called and after that there is some user defined exception.

Thanks,
Aditya
7 years ago
The URL is relative. Its something like . response.sendRedirect("confirmation.jsp")

I can't see the logs for exception because its on some other machine. But I'm puzzled because its working properly on my local setup.

Also, just the redirect is not happening and all the backend updations are happening.

thanks,
Aditya
7 years ago
Hello,

I have a servlet which has a some logic after which it does a send redirect.

response.sendRedirect("url") ;
Now this works fine on my local setup and the url page is displayed properly. However, when I try it on a different setup, the url shows a servlet name and the page is blank.

What might be the reason for this ? . There is a return statement after the redirect.

Is it some problem with the redirect ?

thanks,
Aditya
7 years ago
Thanks Devaka,

I shall implement using session then.

~Aditya
7 years ago
JSP
Thanks,

So does that mean I can implement it using session for now ?

7 years ago
JSP
I just need inputs on whether the session object can be used to significant data.

What is the memory allocated to a session object and does it tend to overflow if the data size increases ?

Kindly help me with this query.

Thanks,
Aditya
7 years ago
JSP
Hello all,

I'm having a web reporting system developed using J2EE. There are several reports and each of these reports have several columns(8 on an average). The column data can be sorted and filtered.

I have to write a logic to enable the saving of sort and filter for a particular user.

There are 2 flavors here, one is the permanent saving of data, where the data will be saved in the Database. The second one is the temporary saving of data, where the filter/sort data will be saved till the session exists.

Now every time the user makes any filter to any report, I need to save that data so that if the user browses through some other report and comes back, he should see the filtered report.

Now, there are again two options for me to save. The first one is saving the data to session and accessing it from the session variables.
The second one is database again where every time a filter is used, the values will be stored to the DB.



Storing data in the session seems to be a better option for me considering the frequent DB operations to store the temporary data.

My question here is that, is it advisable to store this data to session ? Whats the recommended suggestion for storing the temporary data ?


Thanks,
Aditya

7 years ago
JSP
Thanks,

I've tried putting random JavaScript under script tags, but it didnt reflect. Can I put a JavaScript alert in a JSP page without calling without an onClick JavaScript function or form submit ?
Actually I have a question in the JSP and JavaScript.

I call a method from a JSP page. This method exists in a model class which in turn calls a sql. The data gets saved in a table.

The response of this method is a boolean variable which I get in a JSP. Now I wan't to show a temporary message like "Save successful" in the JSP page, which should flash for around say 4-5 seconds and disappear. Or probably a JavaScript alert which will show that the save is successful.

So my question here is can I use JavaScript alerts under script tag without actually calling a JavaScript function ?

Thanks,
Aditya

Hello,

Sorry for the subject line.

I have a JSP file inside which I'm having an AJAX call which opens another JSP as a dropdown on clicking.

One of the options in the dropdown JSP is "Save data". When I click here, it would save data in the database and return some true or false back to the JSP.

I want to show a temporary message "Saved successfully" on the JSP page after the method return. Can anyone suggest me methods to print a temporary message?

Thanks,
Aditya
Hello,

I'm getting the following stack trave when I try to execute a particular functionality.

However my functionality is getting executed properly on our setup. Now the application is not going to ErrorPage.jsp, still its shown in the stack trace. Can someone tell me what are the below mentioned errors ?

9/7/10 1:33:31:384 CDT] 0000002b ServletWrappe A SRVE0242I: [MyServlet]: Initialization successful.
[9/7/10 1:33:59:775 CDT] 00000034 ServletWrappe A SRVE0242I: [/ErrorPage.jsp]: Initialization successful.
[9/7/10 1:33:59:947 CDT] 00000034 WebApp A SRVE0181I: [XXX] [/XXX] [Servlet.LOG]: <null>: <null>
[9/7/10 1:34:00:057 CDT] 00000032 WebApp A SRVE0181I: [XXX] [/XXX] [Servlet.LOG]: <null>: <null>
[9/7/10 1:34:00:150 CDT] 00000030 ServletWrappe A SRVE0242I: [/test.jsp]: Initialization successful.

~Aditya
7 years ago
Basically this is not executing

Hello,

I am using IFrames which has a source test.jsp. When I click a link on the parent jsp file, the submit function calls the server side program which runs a logic and sets a request parameter to true. I redirect the page to "test.jsp"
which checks for a condition and sets a parameter on the parent jsp page.

Now, this setting of parameter on the parent page is using a JavaScript which is not getting called at all. Can someone help me with this ?

Following is the code snippet from test.jsp which tries to set the parent page parameter.

test.jsp



The parent jsp component is




Please help