Can I use PropertyResourceBundle in my Servlet?
hello ,
my servlet ,using PropertyResourceBundle,throws FileNotFoundException .
from error log.
java.io.FileNotFoundException:res_ja_JP.class
java.io.FileNotFoundException:res_ja.class
java.io.FileNotFoundException:res_ja_JP.class
java.io.FileNotFoundException:res_ja.class
resource file is 'res.properties' !!!.
why servlet runnner will not use it?
on JDeveloper debugging enviroment my servlet works well, and also Tomcat Servlet Engine too.
please tell me how to use property resource.
thanks advance.
Thanks gimbal2.
What I'm aiming to do it a bit too complex for JavaScript. I'm hoping to be able to process some (quite large) images server-side, which may be in a queue, and will be saved in an images folder. I'd like user's to be able to submit requests for an image to be created without having a Java front end, then returning and checking whether the image has been processed.
The images are created by merging different sub-images together in different patterns, transforms, rotations which are defined by the user on the JSP page.
If the "invisible" server-side nature of the image processing I suggest is definitely not possible using a Servlet, would it be a better idea to use a hidden Applet and LiveConnect?
Similar Messages
-
Can I use XSQL pages & XSQL Servlet for oracle 7.3 ?
Can I use XSQL pages & XSQL Servlet
for oracle 7.3 or not?,if it is possible
please give me reply.
Thanks.
Ramesh Nallapu.Can I use XSQL pages & XSQL Servlet
for oracle 7.3 or not?,if it is possible
please give me reply.
Thanks.
Ramesh Nallapu.
null -
How can i use twain from java servlet?
dear all
iam a web developer ,iam haviving now a task to search in point pf scanning image through web (Intranet) using java
can any one tell where can i find resources how to deal with Twain using java (On web specially not from a desktop application)
i hope u can help me
Thanks in advance
Yours,
Amr
Senior Java Web developerHi,
You can try a package named: JTwain, which is available at http://asprise.com/product/jtwain.
JTwain supports all kinds of digital cameras and scanners. You can use Java to access, contorl digital cameras and scanners, and of course, to acquire images with flexible settings.
The developers' guide is available @ http://asprise.com/product/jtwain/devGuide.php
In the simplest case, one line of Java code can solve your problem.
Good luck! -
Can we create a object for servlet
and can we use constructor inside a servlet .If yes at what situations we can use
Servlet is an object. Not sure what you need. You can create objects inside a Servlet, or any Java class...
and can we use constructor inside a servlet.Sure, but most people don't because Servlets are container managed (i.e. you don't instantiate it)
If yes
at what situations we can useNot sure what you are asking here, but you can instantiate the servlet anywhere. -
Can I use data from Servlet in my static html page?
First of all, I can NOT use jsp because of web server's restriction.
I have a servlet which will give me some image links in html file via doGET and doPOST method. I also need the sizes of the images and compress the images if too large.
My question is how I can pass the image sizes to the html page and how I can use them in html files.
Please advise me some solutions to this problem.Yeah, you have 2 choices:
1) Change your web server to one that allows JSP.
2) Re-build the JSP system from scratch so that the one you make will work in your server. This would involve changing your so called static HTML to have markings (like <% %> tags) where you should insert the values you need to insert. You would then have a servlet that reads the 'static' HTML, parses our the insertion tags, and inserts the values. It would then stream the results back to the user.
Of course, your HTML is not really static, it is dynamic because the values you are inserting are capable of changing.
If you don't want to upgrade the server to one that supports JSPs (if yours really doesn't), the have fun making your own system. -
How can i Use SERVLET with RMI to avoid trust certificate
I know that for begining RMI, you must launch the server and the client.
for the server i use :
java -Djavax.net.ssl.trustStore=server.keystore -Djavax.net.ssl.keyStore=server.keystore -Djavax.net.ssl.keyStorePassword=server TestServer
for the client I use :
java -Djavax.net.ssl.trustStore=client.keystore -Djavax.net.ssl.keyStore=client.keystore -Djavax.net.ssl.keyStorePassword=client TestClient
and all work fine.
but i want to use a servlet for rmi client and i wrote this:
public class AppelServlet extends HttpServlet
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
try
System.out.println("Registering secure RMI socket factory ...");
java.rmi.server.RMISocketFactory.setSocketFactory(new SecureRMISocketFactory());
TestRemote test = (TestRemote) Naming.lookup("rmi://127.0.0.1:7123/TestClient");
String reponse=test.toLowerCase("HELLO WORLD");
System.out.println("la reponse est : "+reponse);
catch (Exception e)
System.out.println("test client exception: " +e);
PrintWriter out = response.getWriter();
response.setContentType("text/html");
and i have the following error on tomcat:
Registering secure RMI socket factory ...
test client exception: java.rmi.ConnectIOException: error during JRMP connection
establishment; nested exception is:
javax.net.ssl.SSLHandshakeException: Couldn't find trusted certificate
i think i must precise how to indicate the truststore like in the first case.
help me please.
hamdiHi,
Try doing the following steps.
Assuming you have a certificate obtained
Export the certificate into a .cer file.
On IE, goto tools->internet options->content->certificates, and export to a .cer file.
Using keytool of java import the certificate to the store that can be used doing the following command.
keytool -import -alias <ailas> -file < .cer filename> -keystore <storename here>
set the javax.net.ssl.trustStore and javax.net.ssl.trustStorePassword properties at the command prompt using the command below.
java -Djavax.net.ssl.trustStore=<storename> -Djavax.net.ssl.trustStorePassword=<password> <classname>
Let me know if this helped.
Also take a look at this link for using RMI with SSL
http://java.sun.com/products/jdk/1.2/docs/guide/rmi/SSLInfo.html
Regards,
Roopasri Vittal
Developer Technical Support
Sun Microsystems
http://sun.com/developers/support -
How can I use URLConnection to use applet communication with servlet?
I want to send a String to a servlet in applet.I now use URLConnection to communicat between applet and servlet.
====================the applet code below=========================
import java.io.*;
import java.applet.Applet;
import java.awt.*;
import java.net.*;
//I have tested that in applet get data from servlet is OK!
//Still I will change to test in applet post data to a servlet.
public class TestDataStreamApplet extends Applet
String response;
String baseurl;
double percentUsed;
String total;
public void init()
try
java.net.URL url = new java.net.URL(getDocumentBase(),"/servlet/dataStreamEcho");
//String currenturl=new String("http://lib.nju.edu.cn");
java.net.URLConnection con = url.openConnection();
//URL currentPage=getCodeBase();
// String protocol=currentPage.getProtocol();
// String host=currentPage.getHost();
//int port=currentPage.getPort();
// String urlSuffix="/servlet/dataStreamEcho";
// URL url=new URL(protocol,host,port,urlSuffix);
// URLConnection con=url.openConnection();
con.setUseCaches(false);
con.setDoOutput(true);
con.setDoInput(true);
ByteArrayOutputStream byteout = new ByteArrayOutputStream();
PrintWriter out=new PrintWriter(byteout,true);
String currenturl=new String("http://lib.nju.edu.cn");
String var1=this.encodedValue(currenturl); //encode the data
String data="currenturl="+var1;
out.print(data);
out.flush();
con.setRequestProperty("Content-Length",String.valueOf(byteout.size()));
con.setRequestProperty("Content-Type","application/x-www-form-urlencoded");
byteout.writeTo(con.getOutputStream());
BufferedReader in=new BufferedReader(new InputStreamReader(con.getInputStream()));
String line;
while((line=in.readLine())!=null)
System.out.println(line);
catch (Exception e)
e.printStackTrace();
private String encodedValue(String rawValue)
return(URLEncoder.encode(rawValue));
=========================The servlet code below=====================
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
public class DataStreamEcho extends HttpServlet
{public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
res.setContentType("text/plain");
PrintWriter out = res.getWriter();
Runtime rt = Runtime.getRuntime();
out.println(rt.freeMemory());
out.println(rt.totalMemory());
response.setContentType("text/html; charset=GBK");
request.setCharacterEncoding("GBK");
PrintWriter out = response.getWriter();
HttpSession session=request.getSession();
ServletContext application=this.getServletContext();
String currenturl=(String)session.getAttribute("currenturl");
out.print(currenturl);
=============================================================
I have done up,but I found the program don't run as I have thought.
Can you help me to find where is wrong?Very thank!You are trying to pass the current URL to the servlet
from the applet, right?
Well, what I put was correct. Your servlet code is
trying to read some information from session data.
request.getInputStream() is not the IP address of
anything...see
http://java.sun.com/products/servlet/2.2/javadoc/javax
servlet/ServletRequest.html#getInputStream()
Please read
http://www.j-nine.com/pubs/applet2servlet/Applet2Servle
.htmlNo,you all don't understand I.
I want to send an Object to the server from a applet on a client.not url only.I maybe want to send a JPEG file instead.
All I want is how to communicate with a servlet from an applet,send message to servlet from client's applet.
for example,Now I have a method get the desktop picture of my client .and I want to send it to a server with a servlet to done it.How can I write the applet and servlet program?
Now my program is down,But can only do string,can't not done Object yet.Can anyone help me?
=======================applet=============================
public void init()
try
java.net.URL url = new java.net.URL(getDocumentBase(),"/servlet/dataStreamEcho");
//String currenturl=new String("http://lib.nju.edu.cn");
java.net.URLConnection con = url.openConnection();
//URL currentPage=getCodeBase();
// String protocol=currentPage.getProtocol();
// String host=currentPage.getHost();
//int port=currentPage.getPort();
// String urlSuffix="/servlet/dataStreamEcho";
// URL url=new URL(protocol,host,port,urlSuffix);
// URLConnection con=url.openConnection();
con.setUseCaches(false);
con.setDoOutput(true);
con.setDoInput(true);
ByteArrayOutputStream byteout = new ByteArrayOutputStream();
PrintWriter out=new PrintWriter(byteout,true);
String currenturl=new String("http://lib.nju.edu.cn");
String var1=this.encodedValue(currenturl); //encode the data
String data="currenturl="+var1;
out.print(data);
out.flush();
con.setRequestProperty("Content-Length",String.valueOf(byteout.size()));
con.setRequestProperty("Content-Type","application/x-www-form-urlencoded");
byteout.writeTo(con.getOutputStream());
con.connect();
BufferedReader in=new BufferedReader(new InputStreamReader(con.getInputStream()));
String line;
while((line=in.readLine())!=null)
System.out.println(line);
catch (Exception e)
e.printStackTrace();
=======================servlet=============================
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
response.setContentType("text/html; charset=GBK");
//request.setCharacterEncoding("GBK");
PrintWriter out = response.getWriter();
HttpSession session=request.getSession();
ServletContext application=this.getServletContext();
//String currenturl=(String)session.getAttribute("currenturl");
String currenturl=(String)request.getParameter("currenturl");
out.print(currenturl);
File fileName=new File("c:\\noname.txt");
fileName.createNewFile();
FileOutputStream f=new FileOutputStream(fileName); //I just write the String data get from
//applet to a file for a test.
byte[] b=currenturl.getBytes();
f.write(b);
f.close();
} -
Can we use threads in servlets
Hi,
can we use threads in servlets.
cheers
SenYou can also use java.io.Serializable at the end of you class
eg:
public class MyClass implements java.io.Serializable{ -
Can I use servlet as my welcome file
How can I use servlet as my welcome file? I know how to use jsp or html pages as my welcome file but that doesn't work for servlets. I modified my web.xml for making jsps and html as my welcome pages but that <welcome-file-list> tag is not working for servlets.
This was a bug that occured in older Tomcat programs, not sure if it still occurs or not.
Basically, when this happens, you have to have a physical file with the welcome file name. So you would have to create a file named index.do in each of your directories you wanted the welcome to work for. The index.do wouldn't have to actually do anything. It just had to exist. Then when the URL was used to create content, the servlet would be called to create that content. -
How can I use a 3rd party XML parser such as xerces with OC4J ?
Hi all tech experts,
I am using Oracle Application Server 10g Release 2 (10.1.2) and i have
installed Portal and Wireless and OracleAS Infrastructure on the same
computer.
i tried all the solutions on this thread
Use of Xerces Parser in out application with Oracle App Server 9.0.4
but still fighting.
I have also posted this query on OTN on following thread
How can I use a 3rd party XML parser such as xerces with OC4J?
but no reply....
Please help me on this issue.
Since OC4J is preconfigured to use the Oracle XML parser which is xmlparserv2.jar.
i have read the following article which states that
OC4J is preconfigured to use the Oracle XML parser. The Oracle XML parser is fully JAXP 1.1 compatible and will serve the needs of applications which require JAXP functionality. This approach does not require the download, installation, and configuration of additional XML parsers.
The Oracle XML parser (xmlparserv2.jar) is configured to load as a system level library of OC4J through it's inclusion as an entry in the Class-Path entry of the oc4j.jar Manifest.mf file. This results in the Oracle XML parser being used for all common deployment and packaging situations. You are not permitted to modify the Manifest.mf file of oc4j.jar.
It must be noted that configuring OC4J to run with any additional XML parser or JDBC library is not a supported configuration. We do know customers who have managed to successfully replace the system level XML parser and the Oracle JDBC drivers that ship with the product, but we do not support this type of configuration due to the possibility of unexpected system behavior and system errors that might occur from replacing the tested and certified libraries.
If you absolutely must use an additional XML parser such as xerces, then you have to start OC4J such that the xerces.jar file is loaded at a level above the OC4J system classpath. This can be accomplished using the -Xbootclasspath flag of the JRE.
i have also run the following command
java -Xbootclasspath/a:d:\xerces\xerces.jar -jar oc4j.jar
but no success.
How could i utilize my jar's like xerces.jar and xalan.jar for parsing instead of OC4J in-built parser ?
All reply will be highly appreciated.
Thnx in advance to all.
Neeraj Sidhaye
try_catch_finally @ Y !Hi Neeraj Sidhaye,
I am trying to deploy a sample xform application to the Oracle Application Server (10.1.3). However, I encountered the class loader issue that is similar to your stuation. I tried all the three solutions but the application is still use the Oracle xml paser class. I am wondering if you have any insight about this?
Thanks for your help.
Xingsheng Qian
iPass Inc.
Here is the error message I got.
Message:
java.lang.ClassCastException: oracle.xml.parser.v2.XMLElement
Stack Trace:
org.chiba.xml.xforms.exception.XFormsException: java.lang.ClassCastException: oracle.xml.parser.v2.XMLElement
at org.chiba.xml.xforms.Container.dispatch(Unknown Source)
at org.chiba.xml.xforms.Container.dispatch(Unknown Source)
at org.chiba.xml.xforms.Container.initModels(Unknown Source)
at org.chiba.xml.xforms.Container.init(Unknown Source)
at org.chiba.xml.xforms.ChibaBean.init(Unknown Source)
at org.chiba.adapter.servlet.ServletAdapter.init(ServletAdapter.java:153)
at org.chiba.adapter.servlet.ChibaServlet.doGet(ChibaServlet.java:303)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:719)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376)
at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)
at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:299)
at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:187)
at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.ClassCastException: oracle.xml.parser.v2.XMLElement
at org.chiba.xml.xforms.Instance.iterateModelItems(Unknown Source)
at org.chiba.xml.xforms.Bind.initializeModelItems(Unknown Source)
at org.chiba.xml.xforms.Bind.init(Unknown Source)
at org.chiba.xml.xforms.Initializer.initializeBindElements(Unknown Source)
at org.chiba.xml.xforms.Model.modelConstruct(Unknown Source)
at org.chiba.xml.xforms.Model.performDefault(Unknown Source)
at org.chiba.xml.xforms.XFormsDocument.performDefault(Unknown Source)
at org.chiba.xml.xforms.XFormsDocument.dispatchEvent(Unknown Source)
at org.apache.xerces.dom.NodeImpl.dispatchEvent(Unknown Source)
... 18 more -
Using a class or servlet that implements Serializable
Hello everyone,
Can someone please help me. I need to make a program that uses a class or servlet that implements Serializable and then use the values of the variables in servlets.
The first is using it to validate login. then changing the color of the background, header and footer of each servlet.
the variables in the Serialized file are all Strings for color, username, password, header text and footer text.
I tried using the applet tag to run the class in the servlet but it is not working.It's not working because you seem to be making random guesses what servlets, serialization and files are
-
How can I send XML to a servlet without a WebService?
I have created some XML on my Flex app now I want to send it
back to the Servlet, any suggestions on how to do this?
I don't have a web service setup, so I just need to do this
without a webservice.
I appreciate an help!!!!Hi,
You can use HTTPService or RemoteObject.
If you are using HTTPService, then it is very similar to Form
post from a HTML page. HTTPService will allow you to select the
method (POST/GET) in which you want to send the data to the server.
You can add parameters with the data and the send the request to
the server. On the server side, you can either use JSP/Servlet/ASP
or any other server side scripting technology and access the
parameters using request.getParameter("<parameter name>").
Please find more details on how to pass parameters at the URL
below.
http://livedocs.adobe.com/flex/3/html/data_access_5.html#200238
If you are using RemoteObject, then you need to have
BlazeDS/LCDS on the server which will allow you to invoke methods
in any Java class. When invoking any method you can pass arguments
as you were invoking that method from another Java class. Please
find more details on how to use RemoteObject at the URL below.
http://sujitreddyg.wordpress.com/2008/01/14/invoking-java-methods-from-adobe-flex/
Hope this helps. -
How can i use tag library in the mvc?
hello
in some tag libraris such as jakarta tag library and jrun tag library,there is database
access tag, it provide convenient function to access database from jsp page,but i wonder how can i use such a tag within MVC architecture.
as we know,in MVC architecture,all requests from the jsp pages are submit to the controller servlet,then the controller manipulate ejb to access database,it don't allow the database access from the jsp page.
who can tell me how can i combine the tag library with mvc architecture appropriately?
thank you!You can't! If you decide to limit the JSP to be part of the View component, obviously you should not include tags that directly access the database. If the strict MVC architecture is less important to you, then the tags can save coding time. It's your choice.
-
How can I use applet to get the desktop image of client
hi,I have a question to ask u.
How can I use applet to get the desktop image of client? Now I develop a web application and want user in the client to get his current image of the screen.And then save as a picture of jpeg format ,then upload it to the server?
I have done an application to get the screen image and do upload file to server in a servlet with the http protocal.Since the desktop image is on the client's local hard drive, you'll need to look at trusted applets first.
-
How can I use the WebDynpro tutorial template in APAB workbench?
Hi,
I have downloaded the tutorial template zip file from sdn (https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/webdynpro/tutorial on creating trees in web dynpro - 12.htm), but I don't know how to use it in ABAP workbench.
Is that only for Java environment and can be used in Eclipse?
If not, How can it be used in APAB workbench?
Thank you.
Swee HuHi,
Its a template used in NDS(NetWeaver Developer Studio),in Webdynpro perspective.
what do u mean by how can i use it in ABAP workbench?
Sorry u cant use tat existing template.
if u need the same feature u have to develop ur own...:)
Regards,
Sirisha.R.S
Maybe you are looking for
-
Display schedule qty - Month wise in ALV Grid
Hi Experts, I have a requirement to display the schedule line quantities month wise in ALV Grid. The columns sholud be dynamic columns based on the input date range. I got some idea about how to create dynamic ALV but it is not clear to implement in
-
Updating Windows 8 to Win 8.1 Preview
I have an Apple iMac 27" with Windows 8 Pro on a bootcamp partition with all the latest updates installed. I downloaded the KB2849636 Update, and Win 8.1 appeared in the Store. I downloaded the Win 8.1 update and went through several restarts with th
-
Smartform main window in version 6.0
hi experts, im working on smartforms. my doubt is how many main windows we can create in a smartform? in 4.7 version it allowed a single main window. then what is the case in version 6.0. plz some one help me. give me the complete details abt no.of m
-
How to insert some strings in a query with the clausule 'in' in a procedure
Hello fellows. Do you know how to insert some strings in a query with the clausule 'in' in a procedure (with a variable)?. I tell us my problem with an example: I want to use this select but introducing a variable instead the 'value1', 'value2': sele
-
21 repair tickets unsolved in a year for upload speed
This is what the tech told me from the logs. Traceroute timeout at Verizon's end. This is after sending someone out last week who replaced my ONT which fixed nothing. Many hours on the phone going through automated and human (if you can call them tha