Redirect from jsp bean to jsp or html page

I am facing a problem in redirecting to a jsp page from jsp bean
How do i redirect from jsp bean to any other page like jsp or html.
[email protected]

Hi
The solution you suggested we tried it long before only but it is not feasible for us as we have to implement it in all web pages which are in thousands.
My need is like this.
We have given specific time to each of our registered user , as user logs to our portal we calculate session time in bean and as he logs out is new time gets updated. (its like dial up connection)
Now what happens consider user has left only 10 minutes balance, I can calculate and keep track for his time in bean.Now as the time becomes zero I want to redirect him to home page.
As u said i can get return value zero for bean and can do it ,but our webpages are near about thousands.

Similar Messages

  • Calling function from Backing Bean or JSP page

    We are on Jdeveloper 10.1.3.3.0, ADF Faces, JSF Faces .., Currently there is a function call from Javascript event (onmouseover) in the JSP page. I want to call this function from a backing bean or JSP page, as I have to pass some values to this function.
    For Ex., I have a function call like return submit('A','B','Test'); on the Javascript event (onmouseover) in jsp page. I want to remove this function from the javascript event and call from backing bean or jsp page to pass some values into the submit() function. I appreciate if anyone can give some example of how to call this function from backing bean or jsp page in the <SCRIPT> or <SCRIPTLET>
    Thanks,
    Ram

    A use case would be helpful so that we can get a better idea of what you want to do.
    As a general rule, there is no way to call a client side Javascript function from a backing bean, which is server side. However, there are ways to inject information from a backing bean into your Javascript call. For instance, I have an application that uses Google Maps API. It has an onload call to a Javascript function that builds the map and designates it's center point. The center point comes from a backing bean as latitude and longitude properties. So here is my body tag:
    <afh:body onload="initialize(#{backing_searchResults.latitude},#{backing_searchResults.longitude},#{searchCriteria.distance})"
              onunload="GUnload()">onload calls the Javascript function called initialize, and passes the latitude, longitude, and distance from the bean. Is the function really being called from my backing bean? No - the parameters are hard coded into the onload event code when the page is rendered. Does it do the job? Sure it does.

  • How to open an Applet from a text link in a HTML Page

    Hi There
    How to open an Applet from a text link
    in a HTML page
    For example I have a HyperLink "Open Applet"
    When a user clicks that link i want to open a
    Applet in a AWT Window.
    How can i do this
    Will any one help me?
    -Ramya

    u can use javascript for that
    <SCRIPT language="javascript">
    function loadAppNow() {
    document.write("<APPLET ......></APPLET>")
    </SCRIPT>
    LoadApplet
    this will overwrite the applet on current window
    There are many good ways other than document.write to open in same window. I don't remember the syntax right now.
    Plz. refer to javascript tutorial for that.
    even you can insert the applet while retaining previous contents. its quite easy actually.
    regards....bhart

  • How to use getContent() method in custom JSP Provider to display a HTML Pag

    Hi,
    If anybody knows how to use getContent() method to use in custom jsp providers (developed by ourselves) so that it can be used to retrieve a jsp page (a simple html page) ..
    I want the code in the provider java file to for the getContent method...
    Pls. get back to me asap....if any body has implemented a custom jsp provider...as it's urgent...
    I have alreday placed the JSP file in the directory structure /etc/opt/SUNWps/desktop/default/channel_dir..But still the jsp is not being displayed..
    Pls get me the getContent() method code to retrive the JSP file..
    satyabrata

    Hi,
    You don't have to do anything in the custom JSPProvider's getContent method except the call {  return super.getContent(request,response); } . If all you want is just to show your jsp, then create a channel from the default JSPProvider, and edit the property contentPage of that channel from samplecontent.jsp to your jsp name, save the changes and login again. You should see your JSP.
    Sanjeev.

  • JSP, downloading files and show html page

    I like to download files and show a html page on JSP.
    With the source following, downloading works well.
    But, it is just remained on the previous page, not showing the next html page.
    Someone tell me why is it?
    <%@ page import="java.io.*, java.net.URL"%><%
    String file_name = request.getParameter("file_name");
    File fileDir = new File(config.getServletContext().getRealPath("upload/"));
    File theFile = new File(fileDir, file_name);
    FileInputStream fin = new FileInputStream(theFile);
    response.setHeader("Content-Disposition","attachment; filename=\"" + theFile.getName()+"\"");
    response.setContentLength((int) theFile.length());
    BufferedInputStream bf = new BufferedInputStream(new FileInputStream(theFile), 8096);
    int i;
    while ((i=bf.read()) != -1)
    out.write(i);
    bf.close();
    out.close();
    %>
    <html>
    <head>
    <title>file download</title>
    </head>
    <body>
    <p align="center"> </p>
    <p align="center"><b><font face="Tahoma" color="#000000" size="2">You have
    successfully downloaded your file(<%=file_name%>)!</font></b></p>
    </body>
    </html>

    You's already close the JSP output stream befor you try and write your html confirmation, and I don't think browsers can provide the kind of functionality you're trying to demonstrate here. A browser will download the file and open it directly itself or using another application based on user input (e.g. save as, open file, etc.). Once the file is opened or downloaded, it's done!
    I think your best bet is to show a dialogue that the user's download should begin, then set the pages href w/ JS to the location of the file, same way other sites that allow you to download files do it. Go take a look at download.com or something like that.
    Hope that helps.

  • Retrive data from different frames in the same HTML page

    Dear sirs,
    Consider a HTML page with 2 frames, frame1.html and frame2.html. Frame1 contains a textbox, and frame2 contains an "Ok" button.
    Could it be possible that, once I click "OK", and after being redirected to the proper servlet, such servlet could retrive information from Frame1?
    Or, in other words, it is possible for a servlet to get information from different html pages? (I mean INPUT elements like texboxes or radio buttons).
    Thanks in advance for any ideas provided.

    Hi,
    Try this out:
    window.parent.Frame1.document.formname.textbox1.value
    Best of luck

  • How to extract image from oracle database and display at html page

    Could you help me how to make the image to display. i manage to extract the data but the data is in Blob so i need to convert it so make it display at html page.

    Thanks for ur reply Mr.Rajasekhar
    I tried as u said,
    i tried without converting to sql date ,but still i din't get any results
    java.text.SimpleDateFormat dateFormat=new java.text.SimpleDateFormat("dd/MM/yyyy");
             java.util.Date fromDate=dateFormat.parse(startDate);
            java.util.Date tillDate=dateFormat.parse(endDate);          
              String query1="select MTName,Date,MTLineCount from linecountdetails where mtname='"+MTName+"'  and Date >='"+fromDate+"' and Date <='"+tillDate+"' " ;
            System.out.println(query1);
    //From main method
    databaseConnection("prasu","1/12/2005","31/12/2005");I got the output as
    ---------- java ----------
    select MTName,Date,MTLineCount from linecountdetails where mtname='prasu'  and Date >='Thu Dec 01 00:00:00 GMT+05:30 2005' and Date <='Sat Dec 31 00:00:00 GMT+05:30 2005'
    java.lang.NullPointerException
    null
    null
    java.lang.NullPointerException
    Output completed (4 sec consumed) - Normal TerminationThanks
    Prasanna.B

  • Redirect HTTP 404, 401 errors to custom html pages ?

    Does anyone know how to set up Weblogic 6.1 to TRAP and REDIRECT http 404, 401 etc error messages to custom predefined friendly html pages on the server ?? Here, WL takes http requests directly and outputs the results directly back to the browsers (not going through a proxy server like IPlanet or other web servers).
    So how do I trap HTTP error messages in WL and redirects them to my own custom error pages ??
    Help!

    Hi Aswin,
    Vintela libraries changed in SP3. Usually a 404 error means:
    - Typo in any of the xml tags (you can check opening it in IE)
    - Typo in the SPN (cannot be found). However, you mention seeing in stdout.log "credentials obtained" so it looks that's fine
    - If you are using keytab, comment those lines in web.xml and use the password in Tomcat > Java
    If nothing mentioned above solve the issue, I will suggest you to enable debug in Tomcat and post here the stdout.log
    Regards,
    Julian

  • How to use value returned from a bean in jsp page

    Hi All,
    I have a string array value being returned from a javabean to a jsp page. I want to be able to assign the value to a variable in the jsp page.
    How do I do this?
    Many thanks :)

    thanks for your response.
    I actually used something like this:
    <% String loggedin = log.User(user,password);
    out.println(loggedin);
    %>i am not yet as much of an expert on beans as i would like to be, but i thought it is not really a bean if it has a getter method which takes arguments?

  • JSP Beans or JSP Taglibs?

    Hello, I am not sure if my question is correct, but please pour some light if you can, I want to know if i have a Bean which is used for accessing a Database and performing operations with it and at the same time if i have a taglib which also does the same functionality, which is better to use? Any suggestions are much appreciated.
    Regards,
    Navin Pathuru

    Umm... well, a bean is just a java class that follows
    certain conventions, like it has get/set methods, etc.
    To be a tag, you have to implement or extend specific
    interfaces and refer to the class in a TLD file.
    Maybe we're just not understanding each other.
    Perhaps you just mean that jsp:useBean is a tag?Sorry for the confusion. You are right that I was talking about the jsp:useBean. :P-))))

  • Ho do I disconnect the "warning" of a web page trying to redirect from the "Firefox did not allow this page to reload"? I want the first, but not the second option.

    The new firefox now does not allow many pages to reload. I must click the "allow" button and still it often does not allow a reload. I know I can disable the function, but then I must also disable the warning if a page tries to redirect to a new site. So...Why must I give up a security feature to get rid of an annoying reload issue? I want to be notified when a page tries to redirect, but I don't want an "argument" from the system every time I try to reload specific web sites. How can I keep one and disable the other?

    you need to encode the href so that it can be sent as a parameter value. Otherwise it interprets the & as a standard parameter separator.
    I believe the window.escape function should do this
    var urlValue = window.escape(location.href)
    cheers,
    evnafets

  • Is it possible to stop the same swf button file from having to reload on different html pages

    Please view my website below. Any help would be appreciated. Each time you go to another page the buttons flash white while having to reload. Is there any way around this?
    http://www.kineticcreativeco.com/

    you could also try using the proper bgcolor parameters in your embed code and setting the color to black. this will most likely get rid of the white flash.
    here is some old sample code:
    <OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
         codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
         WIDTH="320"
         HEIGHT="240"
         id="slideshow">
    <PARAM NAME="movie" VALUE="slideshow.swf" />
    <PARAM NAME="quality" VALUE="high" />
    <PARAM NAME="bgcolor" VALUE="#000000" />
    <param name="allowScriptAccess" value="sameDomain" />
    <EMBED src="slideshow.swf"
         quality="high"
         bgcolor="#000000"
         WIDTH="320"
         HEIGHT="240"
         NAME="slideshow"
         allowScriptAccess="sameDomain"
         swLiveConnect="true"
         TYPE="application/x-shockwave-flash"
         PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">
    </EMBED>
    </OBJECT>
    i would recommend: using swfObject instead and also putting all your buttons in one swf.

  • Exit from a Flash App. (not an HTML page)--is there a command()?

    I'm building a multimedia stand-alone *.exe type application
    using Flash. I want to
    have an "Exit" button which goes to an exit Screen (Do you
    really want to Exit? Yes/No)
    Is there an "Exit" function somewhere in the Flash classes?
    Thanks,

    Adobe Livedocs:
    "fscommand () function
    public function fscommand(command:String, args:String =
    ""):void
    Language Version : ActionScript 3.0
    Player Version : Flash Player 9"
    Doesn't look like they are fazing it out to me. Didn't see
    anything about it being depreciated.
    http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/

  • Baked Jsp Beans

    Hi, I am trying to create a header , where you have a menu, then a sub menu. I want to create an object for each menu item. Example :- i have the following items in my menu.
    Overview, licensing, rates.
    So far , i have managed to create an object for the overview, but it gives me errors, all i am trying to do is to reference basic html code from the bean to jsp? here is my bean code
    package header;
    import java.io.*;
    import java.util.*;
    public class DynamicHeaderData implements Serializable {
    * Constructor
    public DynamicHeaderData() {
    super();
    public void DbOverview() {
    System.out.println("<td bgcolor=#0099CC valign=center align=center height=22>");
         System.out.println("  <a href=overview.jsp>");
         System.out.println("<font face=Verdana, Arial, Helvetica, sans-serif size=2 color=#FFFFFF>");
         System.out.println("<b>Overview</b></font></a>  </td>");
    so i call it into my jsp, using the following:
    <jsp:useBean id="dynamicHeader" class="header.DynamicHeaderData" />
    <table cellspacing="4">
    <tr> <%= dynamicHeader.DbOverview() %>
    I get the following error :-
    Can't convert void to java.lang.Object.
    out.print(( dynamicHeader.DbOverview() ));
    ^
    1 error
    Please help, i know this is something simple, i would be extremely grateful, if someone could provide me with a working example of my code, cheers
    sandbox sandra..

    A void method will return no value- your DynamicHeaderData class will print all that output to the output stream that it is currently part of, probably the system console. You could try just using<table cellspacing="4">
    <tr> <%dynamicHeader.DbOverview() %>so that it is not trying to use an out.println. If I was writing it however, I would write the bean method like this:public String DbOverview() {
    StringBuffer buff = new StringBuffer("");
    buff.append("<td bgcolor=#0099CC valign=center align=center height=22>");
    buff.append("  <a href=overview.jsp>");
    buff.append("<font face=Verdana, Arial, Helvetica, sans-serif size=2 color=#FFFFFF>");
    buff.append("<b>Overview</b></font></a>  </td>");
    return buff.toString();
    }Then you are returning a String from your DbOverview method which is output that out.println can handle.

  • Passing Value from BI Beans to XML Publisher

    Hi,
    I have requirement to get data from BI Beans and pass it to XML publisher for display. How to do this handshake (pass value). I read that XML publisher understand only XML data, my doubt is if xml pub can read data from browser/BI beans or not?
    regds
    Prakash

    Can XML publisher read data on the fly from BI Bean/Browser and display in HTML format? Furthermore we want that user should be able to click on these values in displayed HTML page and fetch data from Database and display in new HTML page.
    Is it possible in XML publisher, please advice how to do that.
    Thanks
    Prakash

Maybe you are looking for

  • Disk0s2 error questions

    Alright, so I have heard about this error, and one of my friends got it today. The problem started out as "my computer won't load and has the spinning gear". I then told her to boot in Safe Mode, but it would continuously load. Should it take 2 hours

  • Images pixelated in iDVD main screen

    hi all, i create an annual dvd with slideshows and videos. this is my 8th one and i've never had this problem before! i'm using the idvd them "portfolio". when i first started populated the drop zones, everything was fine. the photos i'm using are hi

  • Audio & video via HDMI to an external monitor with lid closed.

    I would like to run a Macbook Pro Retina (2014) with the lid closed and all video and audio via HDMI routed to an external monitor (Samsung Syncmaster from 2010). Is this possible? When I try this, no sound is transferred to the external monitor and

  • HT1689 what is the "other" on my iPhone in the content use bar along the bottom of the screen when I sync my iPhone with iTunes on my computer

    When I sync my iphone and ipad to itunes on my mac, I have a yellow bar listed as "other" taking space on my phone. Is this something that can be cleaned up on the iphone to make the space it is using avail? I have deleted some photos, music and apps

  • Need some information for jar files upload in Oracle

    Hi, I am developing some java stored procedures which requires uploading about 10-15 jar files or may be more, to the oracle database. One way is to use loadjava and oracle stores classes in those jar files as separate java classes. Is there a way th