How to use JOptionPane in jsp, instead of javascript message alert box?
HI,
How to use JOptionPane in jsp,
instead of javascript "message alert box"?
I hate javascript,
I'd like to only use java in jsp. don't use javascript.
javascript is client side,
jsp is server side. i know that.
how to... instead of javascript box?
how to use ... message box in webpage?
don't use applet,,,, don't use javascript,,,
hm...zzzZzz
I hate javascript..T.T
<SCRIPT language=JavaScript>
alert("hate javascript");
</SCRIPT>
===>>>>
In this way,,
JOptionPane.showOptionDialog(null,"I love java")
I'd like to only use jsp and java and html...in webpage.
don't use javascript....
Why? don't sun provide message box in jsp, instead of javascrip box?
Why?
Edited by: seong-ki on Nov 4, 2007 8:38 PM
Drugs are bad, m'kay?
Similar Messages
-
How to use EJB in JSP...urgent!!!
hello,
i am novice programmer in EJB.
i am using weblogic 6.1 ...
my problem is how to use EJB in jsp page.
my code is as follow..but its not displaying any result.
<%@ page import="javax.naming.InitialContext,
javax.naming.Context,
java.util.Properties,
firstEJB.First,
firstEJB.FirstHome"%>
<%
long t1 = System.currentTimeMillis();
System.out.println(t1);
Properties props = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.TengahInitialContextFactory");
props.put(Context.PROVIDER_URL, "localhost:7001");
Context ctx = new InitialContext(props);
FirstHome home = (FirstHome)ctx.lookup("FirstEJB");
First bean = home.create();
String time = bean.getTime();
bean.remove();
ctx.close();
long t2 = System.currentTimeMillis();
%>
<html>
<head>
<style>p { font-family:Verdana;font-size:12px; }</style>
</head>
<body>
<p>Message received from bean = "<%= time %>".<br>Time taken :
<%= (t2 - t1) %> ms.</p>
</body>
</html>
please tell me the solution.Hi, I don't know if it may be the cuase of your problems, but you should narrow the Object obtained doing the lookup, like this:
FirstHome home = (FirstHome) PortableRemoteObject.narrow(ctx.lookup("FirstEJB"), FirstHome.class); -
How to use taglibs in JSP for Database access
Hi
Could any one please tell me how to use taglibs in JSP for Database access
with regrds
JojoThis is a sample how to connect to a MySQL database with JSTL 1.0:
<%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
<%@ taglib uri="http://java.sun.com/jstl/sql" prefix="sql" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>JSTL MySQL</title>
<link href="styles.css" rel="stylesheet" type="text/css" />
</head>
<body>
<c:catch var="e">
<sql:setDataSource var="datasource" url="jdbc:mysql://Your_Server_Name_Here/You_Schema_Here"
user="Your_Username_Here" password="Your_Password_Here"
driver="com.mysql.jdbc.Driver"/>
<c:out value="datasource= ${datasource}, Class = ${driver.class}"/>
<br />
<br />
<sql:query var="deejays" dataSource="${datasource}">SELECT * FROM Your_Table_Name_Here</sql:query>
<table>
<%-- Get the column names for the header of the table --%>
<c:forEach var="columnName" items="${deejays.columnNames}"><th><c:out value="${columnName}"/></th></c:forEach>
<tbody>
<%-- Get the value of each column while iterating over rows --%>
<c:forEach var="row" items="${deejays.rows}">
<tr><c:forEach var="column" items="${row}">
<td><c:out value="${column.value}"/></td>
</c:forEach>
</tr>
</c:forEach>
</tbody>
</table>
</c:catch>
<br />
<br />
<c:if test="${e!=null}"><span class="error">Error</span>�
<c:out value="${e}" />
</c:if>
</body>
</html>And this thread might help you:
http://forum.java.sun.com/thread.jspa?threadID=639471&tstart=44 -
Hi all,
I'm new to jsp, please let me know how to use cookies with jsp.
I have three web applications, in run time I have to switch from one application to another application based on single login page. I have taught cookies are one of the solution. But while I'm googling I unable to get such a good material.
please give some examples,
Thanks in advance.
achchayyaRead a cookie in jsp
HttpSession session = request.getSession();
Cookie cookie_session = getCookie(request, "COOKIENAME");
if (cookie_session == null) {
sesID = session.getId();
} else {
sesID = cookie_session.getValue();
}or
get all cookie in the browser
This gets all the cookies and according to the cookie name given u can get the cookie value
Cookie[] cookies = request.getCookies();
if (cookies != null) {
for (int i = 0; i < cookies.length; i++) {
if (cookies.getName().equals(cookieName))
return cookies[i];
}but i am not sure if this works for ur requirement try and see -
How to use threads in JSP???
hello
i want to use threads with JSP.
i want to write a jsp page which will
start 2 different threads. the 1st thread should just display a message and the second page should redirect this page to another jsp page.
till the redirection is goin on, the message should be displayed in the browser from the 1st thread.
i dont know actually how to use threads in JSP by implementing the Runnable insterface, if not m then how do i do it ??
thanx
Kamal JaiWhy do you want to use threads to do this ??
If you write a message and do a redirection, the message will be displayed until the other page will be loaded into the browser...
I already launched a thread from a JSP but it was for a four hour process where the user can close his browser windows. -
How to use datagrid in jsp ?
Hi All ,
Can any body let me know , how to use datagrid in jsp pages .I have downloaded the taglibs-datagrid.jar file and taglibs-datagrid.tld. I have saved the .jar File in the WEB-INF/lib and .tld to the WEB-INF directories.
I wrote a program that is getting a collection from the request and i just want to display the objects in the datagrid.Please help me out of this problem.It's better to explain with example. Waiting for a response.
Regards,
RakeshWhy do you want to use threads to do this ??
If you write a message and do a redirection, the message will be displayed until the other page will be loaded into the browser...
I already launched a thread from a JSP but it was for a four hour process where the user can close his browser windows. -
How to use a radio button in enabling/disabling a text box in report progra
Hi,
Could any please let me know, how to use a radio button in enabling/disabling a text box in report program.*& Report ZMR_RADIO_BUTTONS
REPORT ZMR_RADIO_BUTTONS.
PARAMETERS : R1 RADIOBUTTON GROUP G1,
R2 RADIOBUTTON GROUP G1.
PARAMETERS : A1 TYPE I,
A2 TYPE I.
AT SELECTION-SCREEN OUTPUT.
*initialization.
IF R1 = 'X'.
LOOP AT SCREEN.
IF SCREEN-NAME = 'A1'.
SCREEN-INPUT = 0.
SCREEN-ACTIVE = 0.
ENDIF.
IF SCREEN-NAME = 'A2'.
SCREEN-INPUT = 0.
SCREEN-ACTIVE = 1.
ENDIF.
ENDLOOP.
ENDIF.
IF R2 = 'X'.
LOOP AT SCREEN.
IF SCREEN-NAME = 'A1'.
SCREEN-INPUT = 0.
SCREEN-ACTIVE = 1.
ENDIF.
IF SCREEN-NAME = 'A2'.
SCREEN-INPUT = 0.
SCREEN-ACTIVE = 0.
ENDIF.
modify screen.
ENDLOOP.
ENDIF.
START-OF-SELECTION.
*IF R1 = 'X'.
*LOOP AT SCREEN.
IF SCREEN-NAME = 'A1'.
SCREEN-INPUT = 0.
SCREEN-ACTIVE = 1.
ENDIF.
*ENDLOOP.
*ENDIF.
*IF R2 = 'X'.
*LOOP AT SCREEN.
IF SCREEN-NAME = 'A2'.
SCREEN-INPUT = 0.
SCREEN-ACTIVE = 0.
ENDIF.
*ENDLOOP.
*ENDIF. -
How to use chart in jsp by using MS Acess Db
hii
My application is to generate the report using the chart with the help of MS Acess
i heard abt the JFreeChart . I downloaded it but i dont know how to link and use it in my application
plz help me.....
Thank u in advanceI downloaded it but i dont know how to link and use it in my application I'm sure they provide some examples how to use it.
Look at them and try to understand how a JFreeChart is used.
When you have a concrete question about JSPs an JSTL you may come back and ask again.
If you have questions about JFreeChart ask them in the JFreeChart Forum.
andi -
Hello,
can any body tell me how to use the XMHTTP in jsp programming are servlet..what i know is XMLHTTP used in with java script functions..for connecting to servers without refrshing the page.can we use directly in jsp page.if so which APIs we have to use..provide me some help..
regards,Thanks Steve for ur reply..
XMLHTTP is a microsoft related thing..How so? This code works with Firefox & IE6 on Tomcat 5:
<%
String aStr = request.getParameter("a");
String bStr = request.getParameter("b");
String cStr = "";
int a,b,c;
if (aStr != null && bStr != null) {
a = Integer.parseInt(aStr);
b = Integer.parseInt(bStr);
c = a + b;
cStr = ""+c;
} else {
aStr = "";
bStr = "";
String acc = request.getHeader("Accept");
if (acc!=null && acc.indexOf("message/x-jl-formresult")!=-1) {
try { out.print(cStr.trim()); } catch (Exception e) { e.printStackTrace(); }
} else {
%>
<html>
<head>
<title>Add</title>
</head>
<body>
<script>
var xmlhttp=false;
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
xmlhttp = new XMLHttpRequest();
function calc() {
try {
frm=document.forms[0]
url="addbyxmlhttp.jsp?a="+frm.elements['a'].value+"&b="+frm.elements['b'].value
xmlhttp.open("GET",url,true);
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4) {
document.forms[0].total.value=xmlhttp.responseText;
xmlhttp.setRequestHeader('Accept','message/x-jl-formresult');
xmlhttp.send(null);
} catch(E) { alert (E.message); }
return false
</script>
<form action="addbyxmlhttp.jsp" method="get" onsubmit="return calc();">
<input type="text" name="a" value="<%=aStr%>"/> +
<input type="text" name="b" value="<%=bStr%>"/> =
<input type="text" name="total" value=""/>
<input type=submit value="Calculate">
</form>
</body>
</html>
<%
%>That is a direct translation from one of the examples on the page I pointed to earlier.
do we have any
apis in java insteead of
var xmlhttp = new
ew ActiveXObject("Microsoft.XMLHTTP");
var xml_dom = new
new ActiveXObject("MSXML2.DOMDocument");
var xml_domTemp = new
new ActiveXObject("MSXML2.DOMDocument");
these things i want to use java related stuff..is it
possible..
regards,Those things are JAVASCRIPT!! Like I said, most of the work is done in javascript, not the server side stuf.. And the page I pointed you to answers that question. -
I've used beans in JSP.. but how to use EJB's in beans ??
EJB's are deployed in Oracle 8i
Please Help
Thank You.Please find the answer in this HOWTO:
http://technet.oracle.com:89/ubb/Forum2/HTML/006404.html
HOWTO's are archived on the JDeveloper Documentation page:
http://technet.oracle.com/docs/products/jdev/listing.htm (Click on Documentation Tab)
Thanks,
-Roel. -
Hi,
I am trying to use EL in JSP,as EL syntax is ${first.secondvalue},but whenever i write this in my program and i run it,it is showing like this only not the value which it has to show.
I think that EL is not being enabled in my jsp.
I write <jsp-property-tag> in web.xml (DD)to enable it,but still it is not being enabled.
So help me so that I can run EL in my JSP page.
BR//
Anubhav GulatiGoogle is your friend, so search on Google for Tomcat 6.0 and it will show you were you can get it from.
Take a look at the Apache Tomcat Version Chart here:
http://tomcat.apache.org/whichversion.html
Servlet 2.5/ JSP 2.1 -------------- Tomcat 6.0.10
Servlet 2.4/ JSP 2.0 -------------- Tomcat 5.5.23
Since you want Servlet 2.4 and JSP 2.0 which are required for JSTL 1.1, you could get Tomcat 5.5.x , instead of Tomcat 6.0.x
Although I don't know if Tomcat 6 is backwards compatible with Servlet 2.4 and JSP 2.0 , if it is then it's cool to get Tomcat 6.x
web.xml - Servlet 2.4 Version
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
</web-app>-----------------------------------------------------
web.xml Servlet 2.5 version is different
<?xml version="1.0"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee" version="2.5">
</web-app> -
How can use interface in JSP?
hi! friends i have one dought in JSP? it's possible interface in JSP? how?
waiting for ur reply!hi
i think u can not use interface in JSP but u can extend a class which implements an interface -
How to use URL in actionscript Instead of services-config.xml?
Hi Alls,
I would like to set my service's url in actionScript (I don't
want to use compiler option -services witch need to recompile swf
if you change service's url).
I search for a long time on google but I found nothing, and
adobe documentation isn't very clear.
Thank for help!!!If you are relying on a services-config.xml file, then this
must be provided
at compile time because the compiler uses it to generate
code.
If you're not using <mx:DataService>, you can actually
avoid compiling against
a services-config.xml file. This is because for the other
services, such
as <mx:RemoteObject> or <mx:WebService
useProxy="true"> or <mx:HTTPService
useProxy="true">, the main thing the compiler does from
services-config.xml
is to generate the code to instantiate the set of channels
that should be
used to contact a destination in LCDS.
Well... you can do that programmatically in ActionScript...
something like
this:
import mx.messaging.ChannelSet;
import mx.messaging.channels.AMFChannel;
private function channelInit():void
var channelSet:ChannelSet = new ChannelSet();
var channel:AMFChannel = new AMFChannel(null, "
http://{server.name}:{server.port}/mycontext/messagebroker/amf");
channelSet.addChannel(channel);
myRemoteObject.channelSet = channelSet;
Just make sure you call this initialization code before you
make any service
requests. If you're proxied WebServices, be sure that you use
the ActionScript
API instead of the MXML tag so that you can delay when
loadWSDL() is called
because you'll want to setup the channelSet first.
Regards,
Pete
Hello FredFlex,
> Hi Alls,
>
> I would like to set my service's url in actionScript (I
don't want to
> use compiler option -services witch need to recompile
swf if you
> change service's url).
>
> I search for a long time on google but I found nothing,
and adobe
> documentation isn't very clear.
>
> Thank for help!!!
> -
JCA Classpath - How to use library from rar instead of from WLS
We have a stand-alone resource adapter that uses the apache commons net library, and relies on features added in version 2.0.
When we deploy to WLS 10.3.2, we get a class loading error when invoking the adapter. Method org.apache.commons.net.ftp.FTPClient.setConnectTimeout(T)V is not found.
WLS 10.3.2 includes an older version of the library: com.bea.core.apache.commons.net_1.0.0.0_1-4-1.jar.
Despite paclkaging the proper version (2.2) in our rar, the older and incompatible 1.4.1 version from the system classpath is used.
Is there a way to use the version packaged in our stand-alone rar file? I have seen a way to do this for a war file (prefer-web-inf-classes in deployment descriptor).
O know we could to modify the system classpath in the weblogic startup scripts to use the newer library. We prefer not to do this, since we don't know how WLS uses the library internally, and what might be affected by a different version.unfortunately, standalone adapter has not prefer-web-inf-classes or similar feature support.
-
How to use Templates in JSP.
Hi,
is any body knows how to apply templates In JSP technology.
I was wondering if some can give some example or link to a working Example
Thanks in Advance.Hi ,
Try this URL.
http://www.javaworld.com/javaworld/jw-09-2000/jw-0915-jspweb.html
OLabora.
Maybe you are looking for
-
How to Gray out a row in ALV ?
Hi Experts, I am having a requirement to gray a specific row in ALV . Is it possible through List Display ? Or Is it possible through Grid Display ? If it is possible, please let me know how to achieve this . Thanks and regards, Kiran.
-
How to show the variable values in key format in the information tab
Dear all in the information tab of the query, we can see all the filters and the variable value. But we can only see the infoobject <b>text</b> of this variable, how can we do if the user needs to see the <b>key</b> of this variable?
-
Csutom SAP Script in ME23N not displaying data in Form
Hi Experts, I have created custom driver program for PO printing using Form entry_neu, which is printing a SAP script, but the problem is when the form is displayed, data is not populated in the form. While debugging in driver program the data is bei
-
Local interfaces classnotfound exception!
Hello, I am working on a mdb which reference locally a session bean When I try to deploy my jar file I have got an error: RemoteException : java.rmi.ServerException: RemoteException occurred in server t hread; nested exception is: java.rmi.RemoteExce
-
Prompts retain values each time a report is opened - how do I stop this?
Post Author: adrian CA Forum: Publishing Here is the scenario:I develop a report using webi (XI R2) and specify that the filter criteria become prompts. I run the query, while still in designer, and retrieve the data.Things look great so I publish t