Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within JSP
Search Coderanch
Advance search
Google search
Register / Login
Win a copy of
A Functional Approach to Java: Augmenting Object-Oriented Java Code with Functional Principles
this week in the
Functional programming
forum!
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Liutauras Vilda
Ron McLeod
Jeanne Boyarsky
Paul Clapham
Sheriffs:
Junilu Lacar
Tim Cooke
Saloon Keepers:
Carey Brown
Stephan van Hulst
Tim Holloway
Peter Rooke
Himai Minh
Bartenders:
Piet Souris
Mikalai Zaikin
Forum:
JSP
trying to use textarea in jsp
chan choon chee
Greenhorn
Posts: 8
posted 9 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
for now my
jsp
file is something like this
again i am trying to use textarea in jsp and with the help of
servlet
, any pointers?
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Insert title here</title> </head> <body> <form name="Keyboard" action="/CTSystem/Detect" method="get"> <textarea id="Optextarea" name="Optextarea" style="width: 383px; height: 400px; "></textarea> </body> </html>
This is mine servlet file:
package Servlet; import java.awt.BorderLayout; import java.awt.Container; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.io.IOException; import javax.servlet.RequestDispatcher; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.swing.JFrame; import javax.swing.JTextField; /** * Servlet implementation class Detect */ @WebServlet("/Detect") public class Detect extends HttpServlet { private static final long serialVersionUID = 1L; /** * @see HttpServlet#HttpServlet() */ public Detect() { super(); // TODO Auto-generated constructor stub } /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub } /** * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub } public static void main(String args[]) { KeyListener listener = new KeyListener() { public void keyPressed(KeyEvent event) { printEventInfo("Key Pressed:", event); } private void printEventInfo(String str, KeyEvent e) { System.out.println(str); int code = e.getKeyCode(); System.out.println("" + KeyEvent.getKeyText(code)); } @Override public void keyReleased(KeyEvent e) { } @Override public void keyTyped(KeyEvent e) { } }; }}
Bear Bibeault
Sheriff
Posts: 67706
173
I like...
posted 9 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Trying to put AWT or Swing into a servlet is senseless and will not work. You will handle events with JavaScript in the browser, not on the server with servlets.
[
Asking smart questions
] [
About Bear
] [
Books by Bear
]
If you were a tree, what sort of tree would you be? This tiny ad is a poop beast.
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Unable to get property values using jsp:getProperty
exception handling
jsp:setProperty and requestDispatcher.forward problem
i would like to know how to redirect a console output to textarea
JSP Bean,not able to work my first bean
More...