How to use Redirect syntax in jsp?
Hi guys I need your advice. For my web application, upon user clicks on the log out button I will redirect the user back to the main in a given time frame of 5sec for example.
How do I write the redirect syntax? Please help I am a newbie in JSP.
Regards,
~LEroy
if u want to redirect after some time use this script. May be it will be helpful
<SCRIPT LANGUAGE='JavaScript'>
function f1()
<%
<jsp:forward----- forward to ur page");
%>
setTimeout('f1()',2000);
</script>
here 2000 milliseconds. try with this
Similar Messages
-
How can i redirect to my jsp page from servlet in init() method..Becoz that servlet is calling while server startsup..so im writing some piece of code in init() method..after that i want to redirect to some jsp page ...is it possible?
using RequestDispatcher..its not possible..becoz
RequestDispatcher rd = sc.getRequestDispatcher("goto.jsp");
rd.foward(req,res);
Here the request and response are null objects..
So mi question can frame as how can i get request/response in servlet's init method()..Hi guys
did any one get a solution for this issue. calling a jsp in the startup of the servlet, i mean in the startup servlet. I do have a same req like i need to call a JSP which does some data reterival and calculations and i am putting the results in the cache. so in the jsp there in no output of HTML. when i use the URLConnection i am getting a error as below.
java.net.SocketException: Unexpected end of file from server
at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:707)
at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:612)
at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:705)
at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:612)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon
nection.java:519)
at com.toysrus.fns.alphablox.Startup.callJSP(Unknown Source)
at com.toysrus.fns.alphablox.Startup.init(Unknown Source)
at org.apache.tomcat.core.ServletWrapper.doInit(ServletWrapper.java:317)
so plz do let me know how to call a jsp in the start up of a servlet.
Thanks
Vidya -
How to use SSL Technology in JSP.
Can anybody Tell me that How to use SSL Technology in JSP ?
I am using Apache Tomcat 5.0.28 Server.
How to configure the Tomcat server so that it will access any web application supported by Tomcat via SSL ?
Thank you very much in advance.The JSP does not need to know that the request is coming over SSL. If the application must be over SSL, but the server also allows non-SSL communication, then, like I said, you need to build in a Filter that will check if the incoming request is an https or http request and redirect to the https url if the request was http. And you can do that using the method listed in the previous post. As far as setting up the SSL certificate for Tomcat to use, refer to the Tomcat Documentation that comes with the server. Other than those two things, you don't need to know anything else about SSL inorder to run an SSL application through a Tomcat server (or any other enterprise server either, for that matter), but do an internet search for SSL and maybe one or two other keywords that apply to your situation and you should find plenty that will help.
-
How to use bean:write inside jsp:include ?
I got a problem about JSP's syntax. The following is my code:
<%@ include file="<bean:write name="HelloForm" property="target" />"%>
The double quotes inside bean:write is my problem. Could you please teach me how to use bean:write within JSP's include? Thank you!http://java.sun.com/products/jsp/syntax/1.2/syntaxref12.html
Include Directive vs <jsp:include>
The include directive <%@include %> is done at page translation/compile time.
It effectively pastes in a static file, and then compiles the JSP as if it was all one file.
As such, you cannot provide a runtime expression to it.
To do runtime inclusion, you need to use the <jsp:include> tag which does except runtime parameters.
<%String test = request.getParameter("pageInfo");%>
<%String link = test + ".jsp"; %>
<jsp:include page="<%= link %>" %>Unfortunately you can't use the tag with a bean:write tag as well, you can only use runtime expressions, not tag. So you have to do the include with
<jsp:include page="<%= HelloForm.getTarget() %>" />
Cheers,
evnafets -
How to use session object in jsp
hi all
marry christmas
can anyone plz tell me how to use session obect in jsp
rachna
Message was edited by:
rachna_arora82hi rachna,
JSP has a default(implicit) session object...... use the getSession(true) method on the session object and then going u can either get or set attributes depending on the requirement
That was in general and now with the issue u have got..... what u can do is that the u can create session for every user who logs in and when he/she tries to login again then u can probably check for the existing session object in the JSP and perform the logic as required..... any clarifications plzzzzzzz let me know
Thanks n Regards
Naveen M
Message was edited by:
Novice_inJAVA
Message was edited by:
Novice_inJAVA -
sir
plz tell me how to use custom tag in jsp.plz describe it.
i will be thankful to uDo you want to use taglibs or develop custom tags? Either way take a look at these:
http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/JSPTags.html
http://www.stardeveloper.com/articles/display.html?article=2001081301&page=1
http://www.onjava.com/pub/a/onjava/2000/12/15/jsp_custom_tags.html
http://jakarta.apache.org/taglibs/tutorial.html
http://www.ibm.com/developerworks/edu/j-dw-java-custom-i.html
http://www.herongyang.com/jsp/tag.html -
Oepe-12.1.2.1-kepler how to use ADF Templates in JSP page
Hi all,
I use oepe 12.1.2.1 kepler 4.3 and creating JSP page but I can't see any ADF Rich Faces Page in JSP Templates Page of Preferences Dialog. How to use ADF Templates in JSP page?
Thanks,
ThomasSelect the JSP Templates link. Is the ADF Rich Faces Page template listed? Refer Creating the Login Page/4.
Introduction to the Oracle Enterprise Pack for Eclipse (OEPE) IDE -
How to use protected method in jsp code
Could anyone tell me how to use protected method in jsp code ...
I declare a Calendar class , and I want to use the isTimeSet method ,
But if I write the code as follows ..
========================================================
<%
Calendar create_date = Calendar.getInstance();
if (create_date.isTimeSet) System.out.println("true");
%>
============================================================
when I run this jsp , it appears the error wirtten "isTimeSet has protected access in java.util.Calendar"The only way to access a protected variable is to subclass.
MyCalendar extends Calendar
but I doubt you need to do this. If you only want to tell if a Calendar object has a time associated with it, try using
cal.isSet( Calendar.HOUR ); -
How can i redirect to another JSP page automatically after some event
I am developing a Tic-Tac-Toe game which can be played between two players who are on two different machines.
When the first player comes to the Welcome page he will redirected to a Waiting Page when he clicks on the 'Start' button.
When the second player comes to the Welcome page he will be redirected directly to the Game page, on clicking the 'Start' button.
So how can i redirect the first player to the Game page after the second player is available for the game.
And if i want to manage multiple instances of my game how can i do that//
I am using JSP, javascript and MySQL for developing my project, and I am new to all these tools, but i would still like to carry on with all these onlyThis is a bit of a challenge because of the nature of the web. Generally the web is "pull only" meaning that the browser has to initiate any interactions - the server can't push data to the browser if it wasn't asked to.
The easiest way to solve this is using AJAX via JavaScript to periodically poll the server for any status changes. There are other ways (the Comet protocol is one) but they start to get a bit difficult and are still a bit new and not completely supported in a standards way. And to be honest they are still basically polling though in a more efficient way.
Are you using a JavaScript framework? Most of the JavaScript frameworks that I've used have built in support for polling in the background. You'd have to have the JSP/servlet side be able to handle these polling requests from the browser and, when another person joins the game, the server indicates that and sends that back to the browser.
As far as multiple instances I would have the server automatically pair up users as needed. So when the first player arrives he has to wait for another player. When the second player arrives a new game is created for those two players. Now a third player arrives and waits until a fourth player shows up. When player 4 joins another separate game is created. Presumably the conversation between the browser and the server will need to include a "game number" or other unique number so that the server can keep track of the games. -
How to use mxml in a jsp file?
I'm trying to use flex in a .jsp file. I followed the
suggestion that I use the Flex 2 Tag library as suggested by this
link:
http://labs.adobe.com/wiki/index.php/Flex_2_Tag_Library_for_JSP#Download_and_Installation
but I couldn't find it. I also downloaded LiveCycle Data Services
ES but couldn't find the flex-bootstrap.jar.
I have a simple example:
<!--<%@ taglib uri="FlexTagLib" prefix="mm" %>-->
Use the <mxml> tag to insert a Flex application in an
existing JSP page. The following example shows the <mxml> tag
with the source attribute to include an external MXML file:
<mm:mxml source="CustomerServiceChat.mxml"/>
Alternatively, you can use the <mxml> tag with inline
MXML source code, as the following example shows:
<mm:mxml>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
xmlns="*">
<mx:Text label="Hello World">
</mx:Application>
</mm:mxml>
I also added the following code in my web.xml:
<taglib>
<taglib-uri>FlexTagLib</taglib-uri>
<taglib-location>/WEB-INF/lib/flex-bootstrap.jar</taglib-location>
</taglib>
and obviously I get an error because I don't have the
flex-bootstrap.jar file. Please let me know how this can be
corrected. Thanks in advance!Adobe Newsbot hopes that the following resources helps you.
NewsBot is experimental and any feedback (reply to this post) on
its utility will be appreciated:
Adobe - Developer Center : Flex quick start guide for PHP
developers:
Apr 30, 2007 ... In this example, I changed the result data
type to XML with E4X support by setting .... In Flex you would
download a file using this code:
Link:
http://www.adobe.com/devnet/flex/articles/php_getstarted.html
2d. Tutorial - Flex 3 Getting Started - Adobe Learning
Resources:
See Calling XML Web Services over the Web Using the Web
Service References ... For information on integrating PHP and Flex
using AMF to encode the data,
Link:
http://learn.adobe.com/wiki/display/Flex/2d.+Tutorial
Mike Potter: Flex and PHP - A simple sample:
I have other example with PHP and MySql and give the same
error, and a example .... Flex Data Services... I choose None (???)
because I work with php and
Link:
http://blogs.adobe.com/mikepotter/2006/02/flex_and_php_a_1.html
Adobe - Developer Center : Transmitting data between Flex and
PHP:
Sep 4, 2007 ... Now that the user interface is set up and
ready to go you can add the HTTP services to go ask for the data
from the PHP code. In Flex you
Link:
http://www.adobe.com/devnet/flex/articles/flex_php_json.html
Integrating Adobe Flex and PHP:
Mar 1, 2006 ... The first step is to download Flex Builder
2.0 from the Adobe labs ... For example, you could use this same
PHP script to pass data to a
Link:
http://devzone.zend.com/article/11-Integrating-Adobe-Flex-and-PHP
Disclaimer: This response is generated automatically by the
Adobe NewsBot based on Adobe
Community
Engine. -
How to use session variable in JSP function & How to use both JSP Servlet
Hi,
I am new to JSP and servlets
Still I am devloping a website in JSP. I am not mixing JSP with servlets, but I do create Java files for bean, logic and database works.
I try to keep the hard coding part out of JSP.
I dont how to use both JSP and Servlets in combination.
Hence If needed I write some functions in JSP.
but it gives me error
+<%! public void abc()+
+{+
int intUserId = Integer.valueOf((Integer) session.getAttribute("MySession_UserID"));
+}+
+%>+
Saying cannot find symbol session
1) So can u please tell how can I access session variables within JSP function
2) And also give me some links/tutorials about useing both JSP and Servlets in combination.
Thanks
VenkatThe application architecture when you use Servlets and JSP in a standard MVC pattern is explained here (under the heading "Integrating Servlets and JSP Pages") and here ...
-
How to use dreamweaver files in jsp?
Hello All
I am developing jsp files in which i want to use macromedia dreamweaver files i.e flash button and flash text. I am building jsp files in JBulider. Can anyone tell me how to use or bring in these dreamweaver files in the JSP files? Will be greatful for any help given.
ArshadYou should be able to just bring the files into DreamWeaver. It should edit the HTML part of the JSP just fine.
-
How to use standard tags in JSP
Hi all,
Just wanted to know how to use standard tags of endeca in JSP ... say for example to display Dimension Name using standard tags.
Thanks
--Sami was just checking whether we can use endeca TAG'S ( typo mistake in my earlier post not the JSTL standard library )....in my JSP
We cannot use endeca TAG ...as they are for different purpose.
Sameer -
hi,
I created an entity bean and I created an ejb control. Now I would like to
use this ejb control inside of a jsp (no page flow).
When I use the ejb without the control I do the follwing steps :
- get the local home
- call finder methode
- get the local object
- call getMethod() and display content
Can someone please post an example how to use the netui-data tags to do this
steps or do I have to use the controls in a total different way?
Can someone please tell me how to use the ejb control inside a normal java
class?
MichaelDo you want to use taglibs or develop custom tags? Either way take a look at these:
http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/JSPTags.html
http://www.stardeveloper.com/articles/display.html?article=2001081301&page=1
http://www.onjava.com/pub/a/onjava/2000/12/15/jsp_custom_tags.html
http://jakarta.apache.org/taglibs/tutorial.html
http://www.ibm.com/developerworks/edu/j-dw-java-custom-i.html
http://www.herongyang.com/jsp/tag.html -
How to use IBatis paging in jsp?
I'm a new comer in IBatis.If I query the database using the method "executeQueryForList" how to display the record in jsp (for example 10 record) and display next 10 record? I means how to create page number in jsp for user click?
If someone used it please help me.
It is best give me an example.
ThksAny idea?
But I think the method "executeQueryforPaginatedList" will be better.Because it has associated method "nextPage(), previousPage(), gotoPage(),isMiddlePage(), isLastPage(), isNextPageAvailable(),".
What I want to know is how to display the page number according to the resultset.For example,If I want to display this in jsp:
"<<back 1 2 3 4 last>>>"
How to display the number "1,2,3,4"?
I means that if I query 10 record per time how to display it in jsp?
:(
Maybe you are looking for
-
I synced Firefox with my Droid Razr Maxx Firefox. Now Google Calendar hangs on "Loading" and will not function. Clearing cache and cookies does not help. Works the same on any computer Firefox. But Gmail works fine and Calendar is okay under other br
-
How to populate the table using streaming data
Dear folks M about to create a midlet application in which i need to populate my table with the current stock exchange values. Since these values get changed dynamically , I planned to use streaming. Since m new to streaming ,pls someone come up to g
-
It doesn`t let me send text messages
when I go into my imessages I can type but my send button doesnt let me send.HELP
-
Mass Update price of Purchase Order from Info Record
Dear guru , I have created many purchase orders. After this creation I change the prices of linked info records. Does exist a transaction that mass update the price of purchase order from info record ? Thanks.
-
Play 2 movie clips in sequence
Hello everyone, I am looking for a script that can let me do this: If I click a button - 1 movie clip will play X number of frames, and then after it completes, a 2nd movie clip will play X number of frames. It is important that I can do this in one