tags:

views:

47

answers:

1

i have two jsp file and one for get the user input and other for print the result.. i have a class file called getdata.java.. how should i access that class when user input something and print the result in result page...

/// getdata.java when user click button it redirect to result page..

< form action="Result.jsp" method="post"> < input type="text" name="textname" />
< input type="submit" name="submit" value="Search"/> remove

//// class file

public class On_Classes {

public void printData() { .... }

}

/// result page

how could i do this::::

A: 

Perhaps this might help? http://www.rgagnon.com/javadetails/java-0508.html Unless you wanted to link to the java page? If so upload the java class to the WEB-INF directory and then in the form action make it link to /servlet/classname?

Or if you wanted to retrieve form data: String resName = request.getParameter("formfieldname"); in the class.

Daniel
thank for your quick reply::there is no classes folder in my WEB-INF directory. when i manually create ant put it there ,there is a error :: really confuse::
Hmm, first of all. what is you're host? cPanel powered?, if its cPanel powered, just upload it into the WEB-INF directory in public_html? if not, what IDE are you using to compile it?
Daniel
Oh sorry, just checked tags, and you're using eclipse, if you browse the build directory when using eclipse, you should see a file ending with .war, upload that to your site/host
Daniel
eclipse for development
Read last comment please
Daniel
there is no .war file in my build directory. i used tomcat as a server...can't imagine wht's going on:::
Have a look at http://objectmix.com/java/75371-how-deploy-servlet-after-creating-eclipse.html
Daniel