Tom Shypulski

Greenhorn
+ Follow
since Jan 02, 2009
Merit badge: grant badges
For More
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 Tom Shypulski

Hmm. I see no SQLException in my eclispe console it only returns test data System.out.. . The method call returns to a servlet. When I test in my browser it drops back to servlet (http://localhost/servlet/coreservlets.WebAppsServlet?pages=1&linksPerPage=5) and displays blank screen. It should return the data to servlet and depening on what it contains redirect to one of two JSP pages.
I apologize in advance if I did not post this in the correct forum. I'm having trouble getting my prepared statement to execute properly. I have tried creating the SELECT query many different ways this is just one of them. When this method is called it prints out string from System.out.println("BEfore DB call. " + pg + " " + perPg); in my console then drops out with no data returned. In fact it appears my code cannot reach System.out.println("After DB call. "); output. I cannot get the query to execute properly.

Any help would be greatly appreciated.



Thanks Travis, That did give me what I'm looking for but I have another problem.
Can I create folders in this manner in the Tomcat ROOT Directory. My folders fail to create in the ROOT dir when obtianing the path from the solution provided. I am able to create folders one level up in the webapps directory. Are there settings I need to configure without leaveing web server unsecure.

Is it best to keep my .jsp's under the ROOT directory?

Here are snipets of code I'm using to create the directories.

From .jsp I get the ROOT path then append the folder\ folders I want to create by passing a form value.


From servlet I call doCreateDir(relativeDir);


Here is code to create path. Returned is Failure to create directory.


Thanks again.

>
14 years ago
JSP
I'm putting together a website with JSP pages and servlets. I have built a admin control page for some site management. I would like the ability to add a directory like "http:\\localhost\directory\path\files" by typing the path "\directory\path\files" into a text field on a jsp page, store path in MySQL db for use in creating links. I want the path to append to the end of http:\\localhost\. Is this possible using a relitive path as opposed to absolute path. It seems that when I create the new directory File f1 = new File() in my servlet it is relative to my WEB-INF folder, I want it to be reative to my ROOT directory.
14 years ago
JSP
Ah, Yes! I see my error. I've mixed up the getParameter and getAttribute methods. and how they are used.
Very good thank you.
14 years ago
JSP
What is the best and secure way to pass data from servlet to JSP's?
Is it better to pass data attached to the end of a URL from a servlet to JSP? For example http\\:someurl\path\?object=data, and is there a limit when sending data this way. Or is is better to call funtions in the JSP to get the data from a servlet.

How about passing data via session object is ther a limit on size? is it secure?
14 years ago
JSP
[color=#444444]
[/color]
I have a simple if else statement that checks for a user object, if user is logged in it shows there name along with two options 1. Change Passord 2. Logout. If the user is not logged in a login box appears. Problem is when I place the <a href> tags in between the <div> the user functionality will not work for logged in users. If I remove the <a href> tags from the <div> everything works fine.

The user functionality is a variety of forms that are displayed depending on the tab selected. The tabs are created useing javascript and CSS.


<div id #navlogin>
<a href="/logout.jsp"> logout</a>
<a href="/changepassword.jsp"> change password</a>
</div>

Any insight into what could be causing this would be appreciated.