JSP and SSO
Hi,
In the oracle database I have my own schema (let's say it is called mySchema) where I have created a package PKG_MINE. The package contains, among others a function getItems which makes queries on portal30 tables. When I execute the code of this function as a procedure (after changing the function into procedure) from portal everything works fine. I wanted to make a call via JSP to that function. It goes without any problem until I make a query on a portal30 table. Then it returns a blank page. I execute the JSP page out of portal. It seems that there is a problem with SSO (the error I get while executing the query as mySchema in SQL*Plus is
ORA-06510: PL/SQL: unhandled user-defined exception
ORA-06512: at "PORTAL30.WWCTX_SSO", line 849
ORA-06510: PL/SQL: unhandled user-defined exception
ORA-06512: at "PORTAL30.WWCTX_SSO", line 669
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "PORTAL30.WWCTX_SSO", line 935
ORA-06512: at "PORTAL30.WWCTX_API", line 170
ORA-06512: at line 1)
I've searched in Internet but still found nothing. What do I miss? Do the user mySchema has to have read privileges to read the data from portal30 tables? (there are many of them I use). Do I have to be logged in? (I want to show the results to the public user, not authorized one)
I connected to the database both as mySchema and Portal30. With the same results - a blank page.
I would appreciate any help
thanks in advance
Ewa Janiszewska
Are you using JDBC to connect to the DB in your JSP page? If so, then what is happening is that the JSP-JDBC connection to the database is established independently from the connection through the PL/SQL gateway that Portal uses. It doesnt matter if you are building portlets or how you call the jsp, any time you connect with JDBC you are connecting to the database though a different connection than your Portal connection. And as such, the PL/SQL PDK API has no idea that a portal user is logged in, so the calls to those procedures fail. You will probably find the same exception occuring if you try to run that procedure in SQL Plus. There is no portal context set, so it fails.
At this point you have 2 options, that I know of.
1) call this procedure before you call the PLSQL PDK API procedure:
wwctx_api_private.set_context('portal30','portal30');
that will trick the API into thinking the portal30 user is logged in. Becareful with that, as it may be a security risk to allow everyone to run as the portal30 user.
2) a second option is to place all your code in a stored procedure, then from your JSP use a link or a FORM submit to that stored procedure. Because web stored procedures are called through the PL/SQL gateway, they will have access to the Portal session information (that JDBC does not), and should execute those procedures with the proper privelege. One thing to make sure is that the schema that your portal user maps to has privilege to execute the stored procedure you write to access the PDK API.
At the end of that stored procedure, you can include a call to owa_util.redirect_url to send the user back to the JSP page.
So the proccess flow is:
JSP page submits or links to a PL/SQL stored procedure
PL/SQL stored procedure calls PDK API functions, then redirects the user to the JSP page (or where ever they need to go)
I am doing this in an application now it works pretty well. let me know if you have any questions
Similar Messages
-
Hello friends,
I was wondering if anyone could help me with the following issue:
I need to call a WS from a JSP with SSO.
Does anyone have something like source code or turorial ?
PS: The WS I need to call is already consumed from Java WD using Logical Destination.
Any help will be welcome.
Thanx,
Best Regards,
RamatíI'm trying to call a bpel process and I get an error in the responseThere is BPEL. That might be a better place to ask this question. If you do go there be sure to tell them what error message/number you get.
Cheers, APC
Blog : http://radiofreetooting.blogspot.com/ -
Oracle9iAS R2 - Virtual Hosts with Portal and SSO with OIDDAS application
Hi!
I have installed a the machine with name minsk.discover.local. The machine have installed Infrastructure and Portal. The instalation is sucessfull and i work fine. But i have publish Portal to WEB with name intranet.discover.com.br. The Oracle describe:
1 - Create the virtual hosts in SSO and PORTAL - OK
2 - run ptlasst to create SSO Partners Applications - OK
After this steps iwork fine with Portal and SSO, but when i click in portlet to create user to access the application OIDDAS, the Portal redirect to login page of SSO in address mct.com.br, the internal name, when then name not responde in the internet.
I need a help!!!!
Marcio MestiI just spoke to the Oracle App server admins, the two servers in question are clustered.
So my question changes slightly to:
What is the best way to install and configure a webgate for clustered Oracle App servers with mulitple virtual hosts, that are residing behind a load balancer (Traffic Manager)?
Thanks,
Andy -
Authentication to XML DB via WebDAV and SSO
Hi,
Is there any way to be authentified by XML DB via WebDAV and SSO ?
If the access to our infrastructure of database servers is controled by SSO, once I'm authentified by OID (SSO), is it possible to pass that authentification to XML DB through standard port 8080 ?
Thank you for your helpThis is planned for a future (not 10g) release
-
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'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) -
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
-
I switched from iphone 3GS to an iphone4. Now itunes won't sync my apps, music etc? I'm using the current version of itunes for win7.
-
is it possible to add the external hyperlink in these emails instead of the internal hyperlink? in example when I get a list tracking email there are hyperlink that get sent out with these tags Modify my alert settings | View Issue Tracking | mobile
-
I have an package with source , data flow and destination to execute on begin and commit. in the below i have just used for questioning purpose with diagram removing my Data Flow task explaining my problem on execution, i get error as [Execute SQL Ta
-
Hi, So, I have 12 images that appear on across approximately 500 pages. I created these images in PSD and are saved as .png. I decided the size of the images were not to my liking, so, I edited them to my liking. I figured I'd just add the updated
-
I have a Macbook Air with Mavericks. When I startup from shutdown or sleep mode, the Console application opens up. Is there a way for this not to occur?