JSP and Swing
Hello friends,
I am developing a web interface for a knowledge base. Now I have designed my interface in Java Swing. The main reason for choosing Swing is that I need JTree in my program.
I would like to know whether we can use this swing files inside JSP? If not, How to create tree structure in JSP,in which nodes are added according to the values in the database?
Another doubt is that, can we use swing for web applications?
You can't use swing with JSP. JSP produces (mainly) HTML pages to run through the browser.
With JSP no Java is run on the client machine, so Swing objects are out of the question.
You have two options:
1 - If you want to use swing, you will have to write it as an Applet / Application (run java on the client)
2 - Investigate javascript/dhtml tree structures - there are several around. And it has been brought up several times on this forum.
Good luck,
evnafets
Similar Messages
-
What's the difference between jsp and jsf?
who can tell me what's the difference between jsp and jsf?
I'm puzzled when I found some of the technology in jsp is so similar to the ones in jsp( javaserver page)Hi,
Find the difference between JSP and JSF
1. A developer has more control with JSP, but (should) get easier development with JSF
2. Event handling is done differently in JSP (HTTP) and JSF (Java)
3. The UI is designed differently (or should be at least) with JSP (markup) and JSF (components).
4. The end product should also be defined differently - JSP page versus a JSF application.
Is this the only thing that is need to make a decision for either or? Probably not. There are other pieces that need to be taken in account when deciding which technology to use - tools support, enough components, type of application etc.... At this point there are not enough JSF components (although there are some interesting projects underway - Ajaxfaces, Myfaces, ADF Faces, and WebChart 3d) and enterprise tools support is still limited to a few tools vendor. Looking at our ADF Faces components they are currently available as early access (not production) and demands for these components are stacking up, literally, outside my office doorstep. Although I would love to make them production - now! - it is not a viable solution since we are still checking features and fixing critical bugs.
All this combined - not enough enterprise level components in production, lacking tools support etc... - leave customers in a vacuum where the decision is either to continue with JSP, since it is mature and has a wide developer base, or move forward with JSF not sure if the support, or the developers will be there. This is particularly sensitive to customers that need to get started now and be production by summer.
If you are in this vacuum here are some key points promoting JSF:
1. Fundamental unit is the Component
2. Built in event and state management
3. Component sets can be provided by any vendor
4. Closer to ASP.Net or Swing development
5. Choice of UI technology
6. Scale up (rich clients)
7. Scale down (mobile devices)
8. Built into J2EE containers in J2EE 5.0 (tentative) -
Can I use AWT elements in a JSP, and so could I generate events with them?
This is because I�m doing a simple JSP that showing a button, my JSP is:
<html>
<%@ page import="java.awt.*" %>
<%! Button b = new Button("Hola!!!"); %>
<% add(b); %>
</html>
But when I tried to see the button in the browser, my JSP generates the following:
Compilation of '/RAID5/weblogic/myserver/classfiles/jsp_servlet/_gep/_alterno/_23_mayo/__mr4.java' failed:
/RAID5/weblogic/myserver/classfiles/jsp_servlet/_gep/_alterno/_23_mayo/__mr4.java:79: cannot resolve symbol
probably occurred due to an error in /gep/alterno/23_mayo/mr4.jsp line 7:
<% add(b); %>
Could somebody help me please?.....
Can I use AWT elements in a JSP, and so could I generate events with them?
Thanks!!!There are 2 ways to run a web page dynamically:
1) Reload the page via use of javascript or some other scripting language.
2) Use an applet to regularly check a URL for the data
Remember, as Paul pointed out, JSP's only generate HTML output. AWT components need to run inside a JVM not a just the browser.
I could recommend an applet but you may have problems with IE6 not supporting java. Otherwise there shouldn't be too much of a prob.
If you prefer to use an AWT/Swing setup (for example an application) rather than a JSP setup, Webstart is good for delivering online applications which operate standalone or remotely.
When you consider that the Java-Plugin and the Webstart puligin are about the same size it's just a matter of weighing up who your target clients are and whats easiest.
Cheers,
Anthony -
can we achieve all the functionality by programming in Swing,than what we get by JSP.
moreover can we develop a website in Swing?oxbow_lakes wrote:
Lets be clear about this - Swing is infinitely more
capable GUI-wise than HTML/JavaScript (which is what a
JSP can give you). Right on! [smile]
Responsiveness can indeed be better
in some cases, because you don't have to go to the
server every time (ie. you can embed business-logic in
the application).Urr... responsiveness in a Swing gui should never be any slower than a thin client... typically, it should be orders of magnitude faster. There are many obvious reasons why this is true.
Also, there is no need to embed business logic in the Swing application. Instead, you just make requests back to your app server for business logic processing.
The problems you have, however, with Swing are
many-fold.
1. Most browsers will NOT, by default, support Swing
(or Java1.2). Most browsers, of course, being IE5.
Hence you need plug-in technology. Which can be a bit
of pain as therefore you have to worry about
client-browser requirements.This is what Java Web Start is all about. (I think you mention that later). It's a great solution.
2. Distributing applets over the web can give rise to
versioning problems on the client-side. If your applet
takes a long time to load you want it to be stored on
the client's machine. However if you make a change to
the business logic, you need to distribute this change
out to clients.Again, this is solved by Java Web Start. It caches your application, and also ensures that you have the latest version each time you run it. On top of that, it lets developers create incremental updates to their applications.
3. Swing is much more complicated than HTML so making
things like dynamic, interactive tables will take more
time than in simple HTML/JavaScript where it is easy.I disagree. Handling a mouse click is almost exactly as simple as handling a mouse click with JavaScript. (I might even argue, simpler). Swing differs in that there is so much more power available to you.
4. If in processing the page you need to communicate
with the server then this is simple using JSP - the
page is being executed on the server already. No
problem. Using Swing, however, you will need to use
maybe RMI or raw Socket communication to a server
process. The former is more finicky and the latter
requires cleverer code on the server-side to listen to
unpack the incoming streams (all of which is invisible
to you when using JSP). Add firewalls to the equation
and you might find that client-server communication is
well-nigh impossible. Or just beyond your area of
expertise.Communication is not a hard problem to solve. For example, you can write EJB client code from your application just like you would from a servlet (or JSP). Application servers like Weblogic multiplex RMI and HTTP on the same port.
People also use the same controller pattern for Swing apps that they do for JSPs - where the controller logic is stored in servlets. This means that the Swing app makes requests to servlets for business logic processing. This has the two effects of preserving MVC architecture in the system and also effectively 'tunneling' requests through any firewall that allows HTTP. With Java's built in networking support, that's a piece of cake.
The answer is... if you are absolutely needing very
fancy graphical stuff that must be interactive, then
Swing will probably be better - it will be more
responsive and flexible. Otherwise, stick to JSP and
avoid the headaches.I disagree again. When will people realize that the browser was never designed for this task and is woefully inadequate!? [argghh]
I've written Swing-based and browser-based interfaces. Most of my headaches don't come from those mentioned above. Rather, my headaches come from trying to design interactive, intuitive, and fast interfaces using tools never intended for such a feat. Incompatibilities between browsers (implementations of the HTML spec, JavaScript, CSS, DOM) just add more fuel to the fire.
God bless,
-Toby Reyelts -
Difference Between Applet and Swing
Difference Between Applet and Swing
The advantages and disadvantages of both applets and Swing are the small fluffy elephants you get inside of every box. They're quite well trained and can skeletonize your neighbors' annoying pets upon command.
-
Problem with JSP and Java Servlet Web Application....
Hi every body....
I av developed a web based application with java (jsp and Java Servlets)....
that was working fine on Lane and Local Host....
But when i upload on internet with unix package my servlets and Java Beans are not working .....
also not access database which i developed on My Sql....
M using cpanel support on web server
Plz gave me solution...
Thanx looking forward AdnanYou need to elaborate "not working" in developer's perspective instead of in user's perspective.
-
Communication between jsp and abstractportalcomponent
Hello All
Communication between jsp and abstractPortalComponent.
jsp contains one input text field and one submit button.
when the user clicks on submit button it will call the component and that input value will
display in same jsp page.
how this communication will happen?
Rgrds
SriHi Srikanth,
In the JAVA File,
OnSubmit Event,
String inputvalue ;
InputField myInputField = (InputField) getComponentByName("Input_Field_ID");
if (myInputField != null) {
inputvalue = myInputField.getValueAsDataType().toString();
request.putValue("textvalue", inputvalue);
request is IPORTALCOMPONENTREQUEST Object.
In JSP File, to retreive the value,
<%
String textstring = (String) ComponentRequest.getValue("textvalue");
%>
In PORTALAPP.XML File,
<component name="component name">
<component-config>
<property name="ClassName" value="classname"/>
<property name="SafetyLevel" value="no_safety"/>
</component-config>
<component-profile>
<property name="tagLib" value="/SERVICE/htmlb/taglib/htmlb.tld"/>
</component-profile>
</component>
Using the code above, You can pass and read values between abstract portal component and Jsp Page.
Instead of this, I suggest you to use JSPDYNPAGE Component for Data Exchange.
Check the [Link|http://help.sap.com/saphelp_nw2004s/helpdata/de/ce/e0a341354ca309e10000000a155106/frameset.htm].
Hope this helps you.
Regards,
Eben Joyson -
Tree View through JSP and Java Script
Hi,
I am looking for code or ideas of a Tree Structure as shown in in the left side frame of admin console of Sun App server 7 on the browser. I need to create a tree structure which will work on the browser like it works on the Sun App Server 7 admin console. If you had any idea or code, please share with me. I would like to have some idea before I start building it. The tree will be build from the database. So any database design is also helpful. I am planning to have that tree using JSP and EJB.
Please help. If you are not clear what I am looking for, then please drop a line in this forum, so that I can explain it fine.
Thanks in advance.
AmitYou can use the JSP Tree Tag I have developed. This helps you both structuring the tree model itself + it takes care of displaying the tree in a nice way. You can change all HTML code used to display the tree. Also you can build trees dynamically instead of just displaying static trees. Take a look at it here:
http://www.jenkov.dk/projects/treetag/treetag.jsp
Kind Regards,
Jakob Jenkov -
Deploying a WAR file containing .jsp and servlets (also uses JNI)
Deploying a WAR file containing .jsp and servlets (also uses JNI) on Windows 2000
We had problems making it initially work on Sun ONE Web Server 6.0 Service Pack 1 because of lack of good iPlanet Web
Server documentation on deploying such files.
This is how we went about it:
1) Make one of the servlet and JSP (must call another Java Class) web application (.war) examples work with iPlanet Web
Server.
C:\iPlanet\Servers\plugins\servlets\examples\web-apps\HelloWorld\HelloWorld.war
and
C:\iPlanet\Servers\plugins\servlets\examples\web-apps\jakarta-examples\jarkarta-examples.war
a) Go to your Web Server Administration to deploy the application using GUI Web Application Deploy.
(We usually use command line, we experienced some issues with the GUI version, but maybe it is fixed in the new Web Server
service packs)
From browser, open http://yourserver:8888/
Click on Select a Server:Manage
Click on Virtual Server Class
Click on https-yourserver
Click on the Web Applications Tab
Then, click on Deploy Web Application
Enter the following -
WAR File On: Local
WAR File Path: C:\iPlanet\Servers\plugins\servlets\examples\web-apps\jakarta-examples\jarkarta-examples.war
Application URI: /jakarta
Installation Directory: c:\iPlanet\examples\jakarta-examples
By clicking on OK it deployed the application.
I can verify that it is deployed by selecting "Edit Web Applications" and I see the following entry:
Edit /jakarta c:/iPlanet/examples/jakarta-examples
Also, c:/iPlanet/examples/jakarta-examples should have the similar following directory structure ..
- [images]
- [jsp]
- index.html
- [servlets]
- [META-INF]
- [WEB-INF]
- [classes]
- [tlds]
- web.xml
- index.html
I restarted the server and accessed it using the following URL from my IE browser:
http://yourserver/jakarta/index.html
Then I clicked on the JSP Examples and tried some JSP examples.
b) Alternatively, you can also deploy the same example from the command-line.
Make sure C:\iPlanet\Servers\bin\https\httpadmin\bin\ is in your path
wdeploy deploy -u /jakarta
-i yourserver
-v https-yourserver
-d c:\iplanet\examples\jakarta-examples
C:\iPlanet\Servers\plugins\servlets\examples\web-apps\jakarta-examples\jarkarta-examples.war
Restart the web server (I don't think you have to restart, but .. might as well).
2)Deploy your web-application
My Foo.war has the following structure.
You can use jar tf Foo.war to look at the file contents from command line (assuming you have JDK installed and the bin is
in your PATH)
Foo.war
- [META-INF]
- [WEB-INF]
- web.xml
- [classes]
- Bar.class
- MoServlet.class
- [lib]
- ThirdParty.jar
- [natlib]
- extlib.dll
- foo.jsp
Here is our application scenario:
foo.jsp uses a class call Bar (it is not in any package). The Bar java class uses classes from ThirdParty.jar. The
ThirdParty.jar in turn uses JNI to load library extlib.dll. foo.jsp also calls /servlet/Mo as well.
Now to deploy it, do the following:
(a) Make sure that within foo.jsp, you import the Bar class ( I don't know why you have to do it, but if you don't you get
JSP compile error).
<%@page language="java" import="Bar" contentType="text/html"%>
(b) Check web.xml (for Servlets)
Within web.xml, make sure you have the following mappings:
<servlet>
<servlet-name> MoLink </servlet-name>
<servlet-class> MoServlet </servlet-class>
</servlet>
<servlet-mapping>
<servlet-name> MoLink </servlet-name>
<url-pattern> /servlet/Mo </url-pattern>
</servlet-mapping>
(c) Deploy the application
Using command line:
wdeploy deploy -u /foo
-i yourserver
-v https-yourserver
-d c:\iplanet\examples\foo-dir
Foo.war
(d) Change web-apps.xml file (for picking up ThirdParty.jar)
It is located in
C:\iPlanet\Servers\https-yourserver\config
You should see something similar to following after successful deployment.
<web-app uri="/foo" dir="C:\iPlanet\examples\foo-dir" enable="true"/>
Change it to look like following to pick up the ThirdParty.jar
<web-app uri="/foo" dir="C:\iPlanet\examples\foo-dir" enable="true">
<class-loader reload-interval="300"
classpath="C:/iPlanet/examples/foo-dir/WEB-INF/lib/ThirdParty.jar"
delegate="false"/>
</web-app>
(e) Change jvm12.conf file (for JNI)
It is located in
C:\iPlanet\Servers\https-yourserver\config
Add or uncomment the following lines:
#optional - just helps with instrumenting the jsp and servlet code
jvm.include.CLASSPATH=1
jvm.enableDebug=1
nes.jsp.enabledebug=1
jvm.trace=7
jvm.verboseMode=1
#required for JNI
java.compiler=NONE
jvm.classpath=.;C:\JDK1.3.1\lib\tools.jar;C:/iPlanet/Servers/plugins/servlets/examples/legacy/beans.10/SDKBeans10.jar;
jvm.option=-Xrs
jvm.option=-Xnoagent
# not sure if this is needed for iPlanet web server
jvm.option=-Djava.library.path=C:/iPlanet/examples/foo-dir/natlib/ -Djava.compiler=NONE
(f) Change magnus.conf file (for JNI)
We HAD to change this file in order for ThirdParty.jar file to pick up the native C++ code using JNI. Apparently, the
iPlanet Web Server doesn't pick the Environment Variable Path. Because when we had the directory containing the DLL just
in Path, it didn't work.
Change Extrapath directive:
ExtraPath C:/iPlanet/Servers/bin/https/bin;${NSES_JRE_RUNTIME_LIBPATH}
to
ExtraPath c:/iPlanet/examples/foo-dir/natlib;C:/iPlanet/Servers/bin/https/bin;${NSES_JRE_RUNTIME_LIBPATH}
(g) Apply changes from the Web Server Administration Console and Restart the web server.
You should be able to see the behaviour that you want from your application.
http://yourserver/foo/foo.jsp
Hope this was helpful!!!
SonuDeploying a WAR file containing .jsp and servlets (also uses JNI) on Windows 2000
We had problems making it initially work on Sun ONE Web Server 6.0 Service Pack 1 because of lack of good iPlanet Web
Server documentation on deploying such files.
This is how we went about it:
1) Make one of the servlet and JSP (must call another Java Class) web application (.war) examples work with iPlanet Web
Server.
C:\iPlanet\Servers\plugins\servlets\examples\web-apps\HelloWorld\HelloWorld.war
and
C:\iPlanet\Servers\plugins\servlets\examples\web-apps\jakarta-examples\jarkarta-examples.war
a) Go to your Web Server Administration to deploy the application using GUI Web Application Deploy.
(We usually use command line, we experienced some issues with the GUI version, but maybe it is fixed in the new Web Server
service packs)
From browser, open http://yourserver:8888/
Click on Select a Server:Manage
Click on Virtual Server Class
Click on https-yourserver
Click on the Web Applications Tab
Then, click on Deploy Web Application
Enter the following -
WAR File On: Local
WAR File Path: C:\iPlanet\Servers\plugins\servlets\examples\web-apps\jakarta-examples\jarkarta-examples.war
Application URI: /jakarta
Installation Directory: c:\iPlanet\examples\jakarta-examples
By clicking on OK it deployed the application.
I can verify that it is deployed by selecting "Edit Web Applications" and I see the following entry:
Edit /jakarta c:/iPlanet/examples/jakarta-examples
Also, c:/iPlanet/examples/jakarta-examples should have the similar following directory structure ..
- [images]
- [jsp]
- index.html
- [servlets]
- [META-INF]
- [WEB-INF]
- [classes]
- [tlds]
- web.xml
- index.html
I restarted the server and accessed it using the following URL from my IE browser:
http://yourserver/jakarta/index.html
Then I clicked on the JSP Examples and tried some JSP examples.
b) Alternatively, you can also deploy the same example from the command-line.
Make sure C:\iPlanet\Servers\bin\https\httpadmin\bin\ is in your path
wdeploy deploy -u /jakarta
-i yourserver
-v https-yourserver
-d c:\iplanet\examples\jakarta-examples
C:\iPlanet\Servers\plugins\servlets\examples\web-apps\jakarta-examples\jarkarta-examples.war
Restart the web server (I don't think you have to restart, but .. might as well).
2)Deploy your web-application
My Foo.war has the following structure.
You can use jar tf Foo.war to look at the file contents from command line (assuming you have JDK installed and the bin is
in your PATH)
Foo.war
- [META-INF]
- [WEB-INF]
- web.xml
- [classes]
- Bar.class
- MoServlet.class
- [lib]
- ThirdParty.jar
- [natlib]
- extlib.dll
- foo.jsp
Here is our application scenario:
foo.jsp uses a class call Bar (it is not in any package). The Bar java class uses classes from ThirdParty.jar. The
ThirdParty.jar in turn uses JNI to load library extlib.dll. foo.jsp also calls /servlet/Mo as well.
Now to deploy it, do the following:
(a) Make sure that within foo.jsp, you import the Bar class ( I don't know why you have to do it, but if you don't you get
JSP compile error).
<%@page language="java" import="Bar" contentType="text/html"%>
(b) Check web.xml (for Servlets)
Within web.xml, make sure you have the following mappings:
<servlet>
<servlet-name> MoLink </servlet-name>
<servlet-class> MoServlet </servlet-class>
</servlet>
<servlet-mapping>
<servlet-name> MoLink </servlet-name>
<url-pattern> /servlet/Mo </url-pattern>
</servlet-mapping>
(c) Deploy the application
Using command line:
wdeploy deploy -u /foo
-i yourserver
-v https-yourserver
-d c:\iplanet\examples\foo-dir
Foo.war
(d) Change web-apps.xml file (for picking up ThirdParty.jar)
It is located in
C:\iPlanet\Servers\https-yourserver\config
You should see something similar to following after successful deployment.
<web-app uri="/foo" dir="C:\iPlanet\examples\foo-dir" enable="true"/>
Change it to look like following to pick up the ThirdParty.jar
<web-app uri="/foo" dir="C:\iPlanet\examples\foo-dir" enable="true">
<class-loader reload-interval="300"
classpath="C:/iPlanet/examples/foo-dir/WEB-INF/lib/ThirdParty.jar"
delegate="false"/>
</web-app>
(e) Change jvm12.conf file (for JNI)
It is located in
C:\iPlanet\Servers\https-yourserver\config
Add or uncomment the following lines:
#optional - just helps with instrumenting the jsp and servlet code
jvm.include.CLASSPATH=1
jvm.enableDebug=1
nes.jsp.enabledebug=1
jvm.trace=7
jvm.verboseMode=1
#required for JNI
java.compiler=NONE
jvm.classpath=.;C:\JDK1.3.1\lib\tools.jar;C:/iPlanet/Servers/plugins/servlets/examples/legacy/beans.10/SDKBeans10.jar;
jvm.option=-Xrs
jvm.option=-Xnoagent
# not sure if this is needed for iPlanet web server
jvm.option=-Djava.library.path=C:/iPlanet/examples/foo-dir/natlib/ -Djava.compiler=NONE
(f) Change magnus.conf file (for JNI)
We HAD to change this file in order for ThirdParty.jar file to pick up the native C++ code using JNI. Apparently, the
iPlanet Web Server doesn't pick the Environment Variable Path. Because when we had the directory containing the DLL just
in Path, it didn't work.
Change Extrapath directive:
ExtraPath C:/iPlanet/Servers/bin/https/bin;${NSES_JRE_RUNTIME_LIBPATH}
to
ExtraPath c:/iPlanet/examples/foo-dir/natlib;C:/iPlanet/Servers/bin/https/bin;${NSES_JRE_RUNTIME_LIBPATH}
(g) Apply changes from the Web Server Administration Console and Restart the web server.
You should be able to see the behaviour that you want from your application.
http://yourserver/foo/foo.jsp
Hope this was helpful!!!
Sonu -
Hi friends,
[please forgive me if i am posting this in the wrong forum, all seems same to a fresher]
Now, to my problem..i need a suggestion, a way or a method to implement the following!
I am supposed to create a servlet that reads data from oracle database. Once i retrive the data (for example: 6 rows of a table having 4 attributes), i am supposed to pass this data to a JSP page where the data has to be formatted and displayed properly. If i call the same servlet from a different JSP, i should be able to access the data in that JSP and format it in a different way. How do i pass the data to JSP? what method i can use to achieve this task?
Note: I already know about PrintWriter pw = response.getWriter(); and then printing the formated HTML page..but i want to keep the formatting to JSP part and send only the data part that i can access in JSP
Thanks in adavancearun_ramachandran wrote:
[please forgive me if i am posting this in the wrong forum, all seems same to a fresher]Then you should learn to be more observant - after all, we have JSP and Servlet fora, further down the list. :)
I am supposed to create a servlet that reads data from oracle database. Once i retrive the data (for example: 6 rows of a table having 4 attributes), i am supposed to pass this data to a JSP page where the data has to be formatted and displayed properly. If i call the same servlet from a different JSP, i should be able to access the data in that JSP and format it in a different way. How do i pass the data to JSP? what method i can use to achieve this task? You can store the data in your session object. You can even use JavaBeans and the jsp:usebean tag.
[http://java.sun.com/products/jsp/tags/11/syntaxref11.fm14.html]
Note: I already know about PrintWriter pw = response.getWriter(); and then printing the formated HTML page..but i want to keep the formatting to JSP part and send only the data part that i can access in JSPA wise approach - I wish more prople woiuld be as thoughtful. -
What's the difference between *.JSP and *.DO?
Hi. I'm new to JSP programming and noticed that form actions call something like pageName.do -- what's the difference between the .JSP and .DO? When do you call one vs. the other? Thanks.
A request including the jsp extension usually refers to a single JSP file on disk that will be loaded and rendered directly.
A request including the do extension usually refers to a call into a special servlet that will redirect the request to another "controller" class which will in turn do some processing, and then load one or more JSP files to render the response.
The commonest form of the latter is the usage in the Struts framework. The do extension is not mandatory, it just presents a convenient way to distinguish calls that should be handled by Struts from requests for JSPs and other content that are mostly handled by the container (e.g. Tomcat) directly. -
What is the best way of deploying a jsp and bc4j aplication
Hi
I would like to know what is the best way of deploying a jsp and
bc4j aplication in ias 9i.
thanks in advanced
rjcIn the page I simply referenced the facescontext directly... no need for a custom servlet.
public void createcookie() {
FacesContext fc = FacesContext.getCurrentInstance();
HttpServletResponse resp = (HttpServletResponse)fc.getExternalContext().getResponse();
Cookie userCookie = new Cookie("cookiename", "cookievalue");
userCookie.setMaxAge(-1);
userCookie.setMaxAge(3600);
resp.addCookie(userCookie);
return null;
public String readcookie() {
FacesContext fc = FacesContext.getCurrentInstance();
ExternalContext ec = fc.getExternalContext();
Map cookiemap = ec.getRequestCookieMap();
if (cookiemap != null) {
Cookie cookie = (Cookie) cookiemap.get("cookievalue");
return cookievalue;
For reference I could not get getCookies() method of HttpServletRequest to work.. it would only return JSESSIONID. -
Help required with JSP and JMF
Hi
Please check the following thread and let me know if JSP and JMF can be combined together
http://forum.java.sun.com/thread.jspa?threadID=5161428&tstart=0
~Amantake a look at the Java Upload bean and it's examples
http://www.javazoom.net/jzservlets/uploadbean/uploadbean.html -
I want to make a chatroom using jsp, and have some problem, Help!
I want to build a chatroom using jsp and client using plain html, so i need every client could have a constant connection with the web server and will receive messages realtime. But i got 2 problems.
First, how can i turn my buffers off so that messages can get to the client the time it is meant to be. I added
<@page buffer="none">
but seems that it takes no effect, any tricks here? thx
Second, I want every user could have a constant conn. with server but i dont want my server to waste resources on those connection that has already been disconnected.so is it possible to stop executing JSP pages once client has diconnected.Since i found that it will throw no exception writing to the client even if the connection is disconnected in JSPs.
Thanks!!!!!By theway, i'm using TOMCat 5.0 as my JSP container.
-
How to upload a file into server using j2ee jsp and servlet with bean?
How to upload a file into server using j2ee jsp and servlet with bean? Please give me the reference or url about how to do that. If related to struts is more suitable.
Anyone help me please!u don't need j2ee and struts to do file uploading. An example is as such
in JSP. u use the <input> file tag like
<input type="file"....>You need a bean to capture the file contents like
class FileUploadObj {
private FormFile srcFile;
private byte[] fileContent;
// all the getter and setter methods
}Then in the servlet, you process the file for uploading
* The following loads the uploaded binary data into a byte Array.
FileUploadObj form = new FileUploadObj();
byte[] byteArr = null;
if (form.signFile != null) {
int filesize = form.srcFile.getFileSize();
byteArr = new byte[filesize];
ByteArrayInputStream bytein = new ByteArrayInputStream (form.srcFile.getFileData());
bytein.read(byteArr);
bytein.close();
form.setFileContent(byteArr);
// Write file content using Writer class into the destination file in the server.
...
Maybe you are looking for
-
Goods Issues done with Purchase Price and not MAP
I would like to know on the inventory valuation from moving average price (MAP)/ average the inventory value to First In First Out (FIFO) basis. FIFO basis is where assumption made that inventory being sold is based on first come first serve basis i.
-
Hi, when I am adding fields to my pivot table in Report in Pwa 2010. I am getting the error below.
-
Hello together. I would like to have a small JLabel where I just have the name and then a big TextField. My problem is as I have it in a GridLayout all are the same size. How can I make that I can choice the size. Thanks in advance
-
Errors afyer software update for my Z10
Right after software update for my bb z10, i can not opewn now setrings, notification and wifi. How can I fix this? Please help
-
Screen layout is not defined for company code ZVVV
Hi I am creating CUSTOMER MASTER in XD01 I am getting an error like "Screen layout is not defined for company code ZVVV" Can any one help?