Can I change the JSP page directive dynamically??

Should I be able to use the JSP page directive...i.e.,
("<% reponse.setContentType("application/vnd.ms-excel"); %>
...to *dynamically* switch the page content depending on the users choice? -- Or, do I have to build separate JSP pages??
I want to be able to switch the content-type based on the user choice from "content="text/html" to "content-type: application/vnd.ms-excel"... or vice versa.
If so, does someone have an JSP example of doing this?
Thanks for any quick response!!

<%
int userchoice = Session("userchoice") // this may also come from database or somewhere
If (userchoice == 1)
reponse.setContentType("application/vnd.ms-excel");
else
reponse.setContentType(content="text/html");
%>

Similar Messages

  • I am using a 5s under IOS 7.1.1. How can I change the year field directly when editing an existing calendar entry?

    I am using a 5s under IOS 7.1.1. How can I change the year field directly when editing an existing calendar entry?

    Glad that helped.
    Enjoy your iPhone!

  • How can I change the default page setup for printing messages in Apple Mac Version 4.6 (1085)

    How can I change the default page setup for printing messages in Apple Mac Version 4.6 (1085)

    As soon as I posted, Ifigured this one out on my own by going into user settings and changing the default there. Then I was able to delete the default @mac account. Thanks!

  • Can't change the master page after upgrading to SharePoint 2013.

    After upgrading our farm to SharePoint 2013 we are having trouble changing the master page for sites that don't have sub-sites. We are still using the v4 UI version, and that appears to be what is causing the problem. The error we get when going to /_layouts/ChangeSiteMasterPage.aspx
    is:
    System.NullReferenceException: Object reference not set to an instance of an object.    at Microsoft.SharePoint.Publishing.Internal.CodeBehind.AreaChromeSettingsPage.OnLoad(EventArgs e)     at System.Web.UI.Control.LoadRecursive()    
    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    I took a peek at the source code for AreaChromeSettingsPage.OnLoad and found that it references a CheckBox control that does not exist in the v4 ChangeSiteMasterPage.aspx:
    protected override void OnLoad(EventArgs e)
    base.OnLoad(e);
    this.EnsureChildControls();
    if (!this.Page.IsPostBack)
    this.LoadValues();
    if (base.Web.Webs.Count == 0)
    this.resetSystemMasterPageSubSitesCheckBox.Visible = false;
    this.resetSubSitesCheckBox.Visible = false;
    this.resetAlternateCssSubSitesCheckBox.Visible = false;
    this.resetThemeSubSitesCheckBox.Visible = false;
    base.ConfigureCancelButton(this.BtnCancel);
    If I manually add a checkbox control with the ID "resetThemeSubSitesCheckBox" to a hidden panel in the v4 copy of ChangeSiteMasterPage.aspx the page works, but obviously this is not a best practice. How can we fix this without upgrading the UI version, which
    we are not yet ready to do?

    Thanks Mike - Could you please share what is your next step then? I also have custom master pages and layout but I am going to make new master page and layout in 2013 as we need to change the existing branding too. so, i upgrade the site collection. I understand
    the Look and Feel will not persist after the upgrade but I am concern that at least the page should show the content on the page after the upgrade. The page had Calendar webppart on it but after the upgrade it is coming blank.
    any suggestion?
    Regards,
    Khushi
    Khushi

  • How can I change the default page for a book?

    I have a book that contains six pages. One of the pages contains the login portlet while the others contain account specific information that a user can only see if they are logged in. Currently, I have the default page set to the login page.
    I am attempting to write a backing file for the book that will esentially change the default page for the book to be one of the other pages if the user is already logged in. In effect showing a logged in user their account summary page instead of the login portlet.
    I can't seem to find a way to change what page the user is shown with the book and page context classes. I can hide the login page, but this leaves the user looking at a blank page. Unfortunately I can't use entitlements, otherwise this would be easy.
    Does anyone know how to "forward" to another page from a backing file?
    Thanks,
    Sam
    Message was edited by:
    straubse

    Got it!
    In your backing file you'll need the following in your handlePostbackData method:
    BookBackingContext bookCtx = BookBackingContext.getBookBackingContext(arg0);
    bookCtx.setupPageChangeEvent("PageLabel");

  • Can I change the "Next Page" key?

    Hey. Is it possible to change the "Next Page" key from the right arrow to some other key on the keyboard? I'd rather use the "S" key to go to the next page, rather than the right arrow..
    Thanks!

    No, Reader does not let you customize keys.

  • How can I make the jsp pages not displayed by using the navigation class?

    I'm right now implementing a function on my program GUI . It's like whenever I click "STOP THE SERVER" button on the main page, I need those jsp pages relates to the server running to be not displayed, even by directly type in the URL(that's just stay in the main page), How can I do that? I heard that a navigation class might do it, but I'm not sure how. It might be great if some experts could help me!! Thanx a million !!
    Shannon

    See:
    * [[Removing the Search Helper Extension and Bing Bar]]
    You can use one of these extensions to adjust the default font size and page zoom on web pages:
    * Default FullZoom Level - https://addons.mozilla.org/firefox/addon/6965
    * NoSquint - https://addons.mozilla.org/firefox/addon/2592

  • Can't change the include page.

    Hi,
              This is the section:
              page1.jsp
              <%@ include file="page2.jsp" %>
              request page1.jsp
              Now I want change page2.jsp and replace the original one, But the exception
              say that page2.jsp has been used by other program, and can't replace it.So I
              have to restart weblogic.
              Pan
              

    Hi,
              This is the section:
              page1.jsp
              <%@ include file="page2.jsp" %>
              request page1.jsp
              Now I want change page2.jsp and replace the original one, But the exception
              say that page2.jsp has been used by other program, and can't replace it.So I
              have to restart weblogic.
              Pan
              

  • I would like to change the project page layouts, but setup option in Project Superuser are not available. How can I change the selected page layouts?

    Hi
    I updated the page layouts for a project in Project Management. Now I woujld like to change those chosen page layouts, but the setup options for the project are no longer available for me to change. How can I update the original chosen page layouts (for performance management) to different layouts or change the chosen layouts to the default (blank) layouts?
    Thanks
    Chris van de Graaf

    AppleMan,
    It all began inside the settings of my Sanyo VPC-HD2000A when somehow the selection got switched from 1280 x 720 to that other setting with so-called 25fps. Also, I don't know whether the mishap occurred before or after I took my new footage.
    I edited the clips last night and now they are on my blog and channel and they seem ok but slightly fuzzy.
    I used a Sanyo VPC-HD2000A .7x wide angle lens with macro and I notice that when I zoomed in to the little sun conure, the picture blurred. I think that might be something that happens when one zooms the focus.
    Also, I was born and raised to a teenager in Hawaii, but now Southern California has me in its grip.
    -L

  • How can I change the main page aps on my 8830?

    Okay I'm now a Junkie! I have the 8830 and I'm with Verizon
    "Hi, my name is Ron and I'm a Blackberry attic"
    does anyone know how to change the applications on the home page? Also is there any way to make my missed calls notification louder, I never hear mine and my customers are getting pissed.
    Also I can't figure out how to make my ringtone louder, I have everything set on Max volume but you can just about here it. Its a real song, not one of those fake harmonicthings they try to pass off as music.
    Thanks
    Ron 

    Hello,
    A search, in these forums, using "bing" as your criteria, will reveal a wealth of data...nevertheless.
    VZW indeed seems to be pushing out bing as the sole available search engine for the BB browser. If, when you received the Bing icon from VZW, you clicked on it and followed it through, it likely changed your search engine to bing and offers no alternatives. This is what I recall others having reported (not having clicked that icon myself, I have no personal experience -- and do not intend to have such).
    From within your Browser app, do this:
    > Options > Browser Configuration
    On that screen is a "Default Search Provider" setting...if you can change it from Bing, then you can do as you please. If it only offers you Bing, then you have already become VZWs victim and, so far, I've seen no recourse to change it.
    Best.
    Occam's Razor nearly always applies when troubleshooting technology issues!
    If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
    Join our BBM Channels
    BSCF General Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • How can I change the default page size for the Adobe PDF Printer?

    Hello All,
    I have cases where I need to switch the default paper size from 8.5x11 to 11x17 via api for the Adobe PDF Printer and have not been able to find how this can be accomplished.
    I am using C# .Net and would appreciate any help.
    Thanks in advance,
    Bob

    There is no Acrobat API for this, but so far as I know there doesn't need to be. The user can go change this from the Printers Control panel as needed. The Adobe PDF printer has some differences from regular printer drivers, but this isn't one of them.

  • Can I change the default page size for SYSBUILD?

    When I start SYSBUILD it always has a default page size of Letter set, is there any way to change this as most of the blocks I wish to print are to be printed on A3 paper?
    Many thanks
    Tim

    Hi Tim,
    Unfortunately there is no option to change the default print settings for SystemBuild. You must manually select the A3 paper size under File>>Page Setup.
    Thanks for the suggestion though, I will pass that on to R&D as a product suggestion for a future release.
    Regards,
    Jeff M.
    Applications Engineering
    National Instruments

  • Hi! How can I change the header text direction to vertical?

    I have many columns with big names, but I need small space for body cells, and I want to check all the table at a view ...  So I want to change the direction of the header texts to "left vertical" or "right vertical".

    There are a couple discussion threads on this already.  Fundamentally it is not a feature that Numbers supports.  There are several work arounds but non of theeem are great:
    Please see this thread:
    https://discussions.apple.com/message/15240103#15240103

  • Can you change the date sort direction in Photos?

    In iPhoto I had my events sorted by date such that the most recent events came first (at the top) and within the events ordered the other way round, i.e. earlier photos at the top of an event. Can you control the sort order of events in the new Photos app to this degree?
    At the moment when I look at the events album that has been imported I can only seem to have the events sorted by name or in date order with the older events at the top.
    NB - Does anyone else think "Photos" is a really dumb name for the app when you consider trying to use any search engine to find information about it?

    when i changed the date forward.... like 20 years forward, it locked and i have to activate it but i cant :S

  • How can I change the printer page orientation from vertical to horizontal?

    I cannot seem to find a way to get the desired page to print horizontally instead of vertically as it normally does. Can I do this; how?
    Currently, Family Tree Maker is the app in which I'm having this problem. I want to print a census report in "landscape" instead of "portrait."

    @sambrack
    Try the '''Preview''' button at the bottom of the Print dialog window and see if there are Portrait / Landscape buttons at the top of the Print Preview window. ''(Those buttons are there on Linux & Windows versions of Firefox, and most likely on Mac, too.)''
    If so, select Landscape and then Print from that Preview window.

Maybe you are looking for