Shamim Emon

Greenhorn
+ Follow
since Jun 16, 2013
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Shamim Emon



Add a System.out.println statement or some other visible cue to make sure it is. (If you don't see anything in the server access log while the applet runs then that likely means the applet does not execute the code at all.)
yap I did that before.When its an applet(not inside the web project as jar file it works..but when it in the web project it doesnt output anything on the console.


That is too much to ask (at least of me, maybe someone else would like to take a look).

Its okay!I completely understand.And sorry I asked for that.
You already have been really helpful.Thanks for that

Cheers
11 years ago
By the way if it isnt too much to ask then can I send you my whole project(.War) any how? This site won't allow me to upolad any zip/war file.Sorry if it seem rude
11 years ago

I put " inside my doPost() and found "http://localhost:8080/Test/MyServlet" is the url being accessedwhen I run the servlet file directly.so isnt it the right url?.But from the applet its not working just as before. When I click on the submit button nothing happens as if I didn't use action listener(although I did) .So where is the bug? isnt it the right url or have I made any other mistake?Please let me know
Thanks
11 years ago

Ulf Dittmer wrote:Start by making sure that you're using the right URL. For that I'd use a the URL constructor that takes a single parameter. That also makes it easier to test the URL outside of the applet. The "codebase " anyway an applet concept that I wouldn't use to create an URL to a servlet. If the servlet listens to "/servletlink", then the URL you're using is almost certainly incorrect.

Furthermore, if you're setting doOutput to true, then you're doing a POST, and consequently need to override doPost instead of doGet.



So now I am using single parametered URL connection
but still doesnt work..ALso I have overrieden thr doPost() insted of doGet().But still can't go to servlet with the bitton press in applet.so what am I forgetting to do??

Thanks
11 years ago
Well, I am trying to learn how to communicate to servlet from applet.I have build an applet containing a text field and a button.When I press the button The text field value would be sent to a servlet where it will be displayed.But when I press the button nothing happens. I am giving the layout of my files and code fragments where I suspect I have made mistakes.

Layout of files: I got a web dynamic project "Test" there I have a package"pkTwo" which contrains the servlet "MyServlet.java" For the Applet I used a normal java project and made a jar file and kept it in the "webContent"
along with my jsp which calls the applet using this jar.

heres the method(From my Applet) used for my buttons listener to send the string of text field



here is the doGet() of my servlet


and heres is the web.xml code
What are the mistakes I have made?please let me know
11 years ago
Well, I get class not found exception.And,here is the layout of my flies:
AppletTest(Web dynamic project).There I have the package"pk1"which contrains the appletcode"MyApplet.Java"
"WebContent" folder contains the jsp file which contains the the code fragment I paste above.
Thanks once again
11 years ago
Thanks for the reply.I was wrong about "src" directory.I am still unable to get the applet.If I understand you clearly then the code attribute should contain only class name even if it is in a pakage?like code="MyApplet.class"
also if the correct directory is "AppletTest\build\classes\pk1"where pk1 is the package name then codebase="/AppletTest/build/classes/" right? Still cant find the applet.So far I am only able to get the applet only when I make a jar file which is in the same directory as the jsp file by archile="somename.jar". Its kind of eating me why can't I do it with the code base .Some more help would be really appreciated.
11 years ago
Hi, I want to invoke an Applet from a jsp file.here is the jsp plugin I have used :

<jsp:plugin type="applet"
code="pk1/MyApplet.class" codebase="/AppletTest/src/pk1"
width="1400" height="800">
</jsp:plugin>

where AppletTest is my Dynamic web project.The jsp file is kept in WebContent folder and and MyApplet.java is stored in pk1 package.so could you please tell me whats wrong with my codbase??
11 years ago