Don’t look where you fall, but where you slipped
Oracle Certified Professional: Java SE 6 Programmer && Oracle Certified Expert: (JEE 6 Web Component Developer && JEE 6 EJB Developer)
Don’t look where you fall, but where you slipped
Don’t look where you fall, but where you slipped
Oracle Certified Professional: Java SE 6 Programmer && Oracle Certified Expert: (JEE 6 Web Component Developer && JEE 6 EJB Developer)
Dieter Quickfend wrote:Be advised that this code will cause a massive explosion and millions will die from the fallout.
Why don't you just put the static code you wrote there in the doGet method of your servlet instead of a static method?
You're also going to need a form in your jsp.
Don’t look where you fall, but where you slipped
Dieter Quickfend wrote:
Why don't you just put the static code you wrote there in the doGet method of your servlet instead of a static method?
You're also going to need a form in your jsp.
Don’t look where you fall, but where you slipped
Oracle Certified Professional: Java SE 6 Programmer && Oracle Certified Expert: (JEE 6 Web Component Developer && JEE 6 EJB Developer)
Don’t look where you fall, but where you slipped
Bear Bibeault wrote:If you know it's bad, what's the purpose of pursuing it?
First of all, scriptlets? In 2011?
Secondly, in your first post you said "after a button is pressed" (or some such). How is embedding Java in a JSP that executes on the server long before the page is even sent to the browser, going to have anything to do with a button press?
There are modern patterns and best practices to do just about anything you need to do in a web application. You are heading astray. Badly.
Don’t look where you fall, but where you slipped
Bear Bibeault wrote:First of all, if you are new to JSP and servlets, read this article and this article.
Secondly, avoid anything to do with scriptlets. They've been discredited for almost 10 years now. A decade. It's completely irresponsible to be putting scriptlets into modern JSP code.
Next, understand that doing anything on the client involves JavaScript, not JSP and servlets. So any question that contains "press a button" is likely to involve JavaScript unless it's a straight-forward form submission. If server-side assist is required, that's where Ajax comes in.
And lastly, learn how to ask non-leading questions. Until you get your feet wet, it's better to ask "how do I do such and such" rather than "how do I use xyz to do such and such" where it's likely that xyz is not the appropriate technology.
Don’t look where you fall, but where you slipped
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |