Help with 301 redirect code - jsp in url

I'm trying to set a 301 redirect in my jsp code (this is tomcat btw) using this:
<%
response.setContentType("text/html");
response.setDateHeader("Expires", 0);
response.setHeader("Location", "http://www.mysite.com/record/pleasehelpme /helpmeheretoo");
response.setStatus(301);
%>
the pleasehelpme and helpmeheretoo need to use variable values i get from mysql which i would normally express in the application like
<%=(((Recordset1_data = Recordset1.getObject("avariable"))==null || Recordset1.wasNull())?"":Recordset1_data)%>
so what do i need to stick in those parts of the path in the url?
it works great redirecting to a flat url but I need those variable (well, that's the point of this anyway).
sticking the <%= recordset stuff %> is breaking since it's like a tag in a tag (i guess) - have tried variations on sticking println around (String)Recordset1.getObject("avariable") like
"http://www.mysite.com/record/(out.println(String)Recordset1.getObject("avariable"))"
and variations with curly braces and semicolons and everything but i keep getting
Syntax error on token "avalue", invalid AssignmentOperator
errors. (i'm obviously tring to figure out just one variable before i stick both in the path while i get this figured out).
can someone hit me with a clue stick?

And then finally I found a .php option (which I saved in my root directory)
<?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.downtoearthlandscaping.ca/#!/page_Home");
?>
I
This works, does your server support php?
You don't need:
header("HTTP/1.1 301 Moved Permanently");
Just this:
<?php
header("Location: http://www.downtoearthlandscaping.ca/#!/page_Home");
?>
Saved as index.php
The server will find index.php and the first page should be displayed.

Similar Messages

  • Need help with a activation code for Adobe Acrobat X Standard for my PC,, Don't have older version serial numbers,  threw programs away,  only have Adobe Acrobat X Standard,  need a code to unlock program?

    Need help with a activation code for Adobe Acrobat X Standard for my PC, Don't have older Version of Adobe Acrobat 9, 8 or 7. 

    You don't need to install the older version, you only need the serial number from your original purchase. If you don't have them to hand, did you register? If so, they should be in your Adobe account. If not you really need to contact Adobe, though it isn't clear they will be able to do anything without some proof of purchase etc.

  • HT3209 Purchased DVD in US for Cdn viewing. Digital download will not work in Cda or US? please help with new Digital code that will work

    Purchased DVD in US for Cdn viewing. Digital download will not work in Cda or US? please help with new Digital code that will work

    You will need to contact the movie studio that produced the DVD and ask if they can issue you a new code valid for Canada. Apple cannot help you, and everyone here in these forums is just a fellow user.
    Regards.

  • Firefox wont open page with a redirect code in it

    I'm using the following redirect code on my website to automatically redirect users on a mobile phone to my mobi site:
    <script type="text/javascript" src="http://216.139.224.162/Home/RedirectToMobile?url=http://mamotorworks.mobi"></script>
    This work fine on all browsers including firefox 3.6. but it won't open the web page in firefox 4.0.
    I get a pop up window asking me open this file with or save file.

    hello, can you try to replicate this behaviour when you launch firefox in safe mode once? if not, maybe an addon is interfering here...
    [[Troubleshoot extensions, themes and hardware acceleration issues to solve common Firefox problems]]

  • Need help with adjusting Javascript code to work in Adobe Edge (Countdown)

    Hello
    Im a newbie when it comes to working with Javascript and Adobe Edge and need a bit of help with adjusting some javascript code to work with Adobe Edge. A friend of mine helped me with making this javascript code: Edit fiddle - JSFiddle
    Its a simple countdown which counts down to a certain time at a certain date. What I aim to do is to add this code as a trigger on a text-element called "countdown" (within a symbol called "count").
    I have tried to do this as the code is, but it does not work. Anyone have any suggestions?
    Thanks!
    Mvh,
    Øyvind Hermans

    Hello again
    I have stumbled upon a problem with these animations; They crash the browser after viewing them a little while, usually less than 30 seconds in.
    Is this problem also occuring when you watch the animations?
    Is the countdown-code to much for the browsers to handle?
    Thanks in advance for your answers.
    Sincerely,
    Øyvind Hermans

  • Help with HTML form code

    I need help on some HTML code if at all possible.
    What I am trying to do is set up a page that someone can
    enter their name address and email into a form and when they hit
    the submit button it automatically sends them a premade email of my
    choosing that I make prior and somehow maybe embeded into the html
    code to the address that they entered? I dont know if it is
    possible but I am sure it can be.
    Thank you in advance

    Actually, you could be subject to "abuse complaints", not
    "abuse".
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "bregent" <[email protected]> wrote in
    message
    news:fb547q$b49$[email protected]..
    > >What I am trying to do is set up a page that someone
    can enter their name
    > address
    >
    > Sure, you can do it fairly easily with any scripting
    language. You need to
    > be
    > cautious about sending automated emails to anyone
    without first validating
    > that
    > they are the actual owners of the email address,
    otherwise you open your
    > site
    > up to abuse.
    >
    > >I dont know if it is possible but I am sure it can
    be.
    >
    > Huh?
    >

  • Need Help With Simple ABAP Code

    Hello,
    I'm loading data from a DSO (ZDTBMAJ) to an Infocube (ZCBRAD06). I need help with ABAP code to some of the logic in Start Routine. DSO has 2 fields: ZOCTDLINX & ZOCBRDMAJ.
    1. Need to populate ZOCPRODCD & ZOCREFNUM fields in Infocube:
        Logic:-
        Lookup /BI0/PMATERIAL, if /BIC/ZOCBRDMAJ = /BIC/OIZOCBRDMAJ
        then /BIC/ZOCPRODCD = ZOCPRODCD in Infocube
               /BIC/ZOCREFNUM = ZOCREFNUM in Infocube         
    2. Need to populate 0G_CWWTER field in Infocube:
        Logic:
        Lookup /BIC/PZOCTDLINX, if /BIC/ZOCTDLINX = BIC/OIZOCTDLINX
        then G_CWWTER = 0G_CWWTER in Infocube.
    I would need to read single row at a time.
    Thanks!

    I resolved it.

  • Would like help with treeset ,the codes that using for sorting, please ?

    hi every body. i faced a problem while writing this program, everything worked properly except this one. The program is related to Jframe and it asks the user to add three labels , three text field , one text area and three Jbuttons which are add sort and exit. i could deal with add and exit but sort, i couldn't do it properly because i don't know the codes that should be added in actionperfomed?
    These codes are :
    package gui;
    import javax.swing.SwingUtilities;
    import java.awt.BorderLayout;
    import javax.swing.JPanel;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import java.awt.Rectangle;
    import java.util.ArrayList;
    import javax.swing.JButton;
    import javax.swing.JTextField;
    import javax.swing.JTextArea;
    import sun.misc.Sort;
    import domain.Student;
    public class StudentFrame extends JFrame {
          * This method initializes btnAdd     
          * @return javax.swing.JButton     
         private JButton getBtnAdd() {
              if (btnAdd == null) {
                   btnAdd = new JButton();
                   btnAdd.setBounds(new Rectangle(13, 135, 59, 27));
                   btnAdd.setText("Add");
                   btnAdd.addActionListener(new java.awt.event.ActionListener() {
                        public void actionPerformed(java.awt.event.ActionEvent e) {
                        btnAddClicked(); // TODO Auto-generated Event stub actionPerformed()
              return btnAdd;
         protected void btnAddClicked() {
              // TODO Auto-generated method stub
         String name = txtName.getText();
         String id = txtID.getText();
         String age = txtAge.getText();
         Student s = new Student(name , id , age);
         txtArea.setText(String.valueOf(s ));
          * This method initializes btnSort     
          * @return javax.swing.JButton     
         private JButton getBtnSort() {
              if (btnSort == null) {
                   btnSort = new JButton();
                   btnSort.setBounds(new Rectangle(95, 136, 62, 25));
                   btnSort.setText("Sort");
                   btnSort.addActionListener(new java.awt.event.ActionListener() {
                        public void actionPerformed(java.awt.event.ActionEvent e) {
                             btnSortClicked(); // TODO Auto-generated Event stub actionPerformed()
              return btnSort;
         protected void btnSortClicked() {
              // TODO Auto-generated method stub
          * This method initializes btnExit     
          * @return javax.swing.JButton     
         private JButton getBtnExit() {
              if (btnExit == null) {
                   btnExit = new JButton();
                   btnExit.setBounds(new Rectangle(173, 134, 61, 23));
                   btnExit.setText("Exit");
                   btnExit.addActionListener(new java.awt.event.ActionListener() {
                        public void actionPerformed(java.awt.event.ActionEvent e) {
                             System.exit(0); // TODO Auto-generated Event stub actionPerformed()
              return btnExit;
          * This method initializes txtName     
          * @return javax.swing.JTextField     
         private JTextField getTxtName() {
              if (txtName == null) {
                   txtName = new JTextField();
                   txtName.setBounds(new Rectangle(79, 11, 60, 23));
              return txtName;
          * This method initializes txtID     
          * @return javax.swing.JTextField     
         private JTextField getTxtID() {
              if (txtID == null) {
                   txtID = new JTextField();
                   txtID.setBounds(new Rectangle(73, 55, 65, 26));
              return txtID;
          * This method initializes txtAge     
          * @return javax.swing.JTextField     
         private JTextField getTxtAge() {
              if (txtAge == null) {
                   txtAge = new JTextField();
                   txtAge.setBounds(new Rectangle(74, 96, 61, 24));
              return txtAge;
          * This method initializes txtArea     
          * @return javax.swing.JTextArea     
         private JTextArea getTxtArea() {
              if (txtArea == null) {
                   txtArea = new JTextArea();
                   txtArea.setBounds(new Rectangle(138, 5, 154, 128));
              return txtArea;
          * @param args
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              SwingUtilities.invokeLater(new Runnable() {
                   public void run() {
                        StudentFrame thisClass = new StudentFrame();
                        thisClass.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                        thisClass.setVisible(true);
          * This is the default constructor
         public StudentFrame() {
              super();
              initialize();
          * This method initializes this
          * @return void
         private void initialize() {
              this.setSize(300, 200);
              this.setContentPane(getJContentPane());
              this.setTitle("JFrame");
              return jContentPane;
    }Edited by: hypocrisy on Apr 26, 2009 6:51 PM

    There are three actionPerformed in that program.One for add Jbutton , Sort , and Exit
    the codes that i have added for add button after action performed are
    String name = txtName.getText();
    String id = txtID.getText();
    String age = txtAge.getText();
    Student s = new Student ( name , id , age);
    System.out.println(s);
    the codes for Exit button to make it works properly was :
    System.out.println(0);
    But when i came to Sort Button and i tried to enter many codes but it didn't sort properly so would you like to help me with the right codes :)

  • Help with basic ABAP code (merge internal tables, sort of...)

    Hello,
    Can someone please help write some basic code for a Basis guy with limited ABAP knowledge?
    Should be some easy points for an experienced ABAPer!
    I have identicaly structured internal tables I_A and I_B and I_C which have already been filled by function models I called.
    How will I code the following?:
    I want to read all the data of I_A into a new internal table I_MASTER (structured the same as I_A,I_B and I_C).
    Then I want to read I_B and:
    1)Update I_MASTER with NEW records
    2)Update existing records if the value of field MYFIELD in I_B is smaller than the value of MYFIELD in I_MASTER.
    Then I want to read I_C and:
    1)Update I_MASTER with NEW records
    2)Update existing records if the value of field MYFIELD in I_C is smaller than the value of MYFIELD in I_MASTER.
    Let me know if I can provide anymore information.
    Thanks in advance for you help!
    Adriaan
    Message was edited by: Adriaan
    Message was edited by: Adriaan

    Hi Adriaan ,
    I want to read all the data of I_A into a new internal table I_MASTER (structured the same as I_A,I_B and I_C).
    <b>i_master[] = i_a[] .</b>
    loop at i_b .
    read table i_master with key myfiled < i_b-myfield .
    if sy-subrc = 0 .
    append i_master from i_b .
    endif.
    endloop.
    loop at i_c .
    read table i_master with key myfiled < i_c-myfield .
    if sy-subrc = 0 .
    append i_master from i_c .
    endif.
    endloop.
    Let me know if this helped .
    Regards,
    Varun .
    Message was edited by: varun sonu

  • Help with some beginner code

    Hello, I am new to java and I need a bit of help with some code that I'm writing. here is the code:
    import javax.swing.*;
    public class Test{
         public static void main(String[] args){
         JOptionPane.showMessageDialog(null,"We will now build a block with *'s","Block",1);
         String input=JOptionPane.showInputDialog(null,"Type a number: ","Number",3);
         int number=Integer.parseInt(input);
         int count=0; int count2=0;
         for(count2=0; count2<number; count2++){
              for(count=0; count<number; count++){
              System.out.print("* ");
    System.exit(0);
    }Now, all I need is to build a block of *'s with the number that the user inputs. With the code that I wrote I get the correct number of *'s but not in the form of a block. They just print out in a straight line. I know this is a very simple task but could someone please help me out? What do I need to modify in my code so that the *'s print out arranged as a block like so:
    **********

    Your code only uses the print method which prints without a carriage return/line feed. So you need to add a line of code to print a carriage return/line feed. Where? well that is your task to work out.

  • Help with http 401 code ?

    [Add] I forgot to mark this as question [Add]
    I wrote a smalll program that send the xml to soap webservice on the server
    If I use the browser to type the link on(http://myserver/myservices/RequestWS) , it pops up a window authenfication box. I type user name and password in and it works (logged in, see the message from the server)
    However, if I run the java code below, the error is thorwn when I write to the outputStream.
    public static void main(String[] args) throws Exception {
    String SOAPUrl = args[0];
    String xml = args[1];
    URL url = new URL(SOAPUrl);
    URLConnection connection = url.openConnection();
    HttpURLConnection httpConn = (HttpURLConnection) connection;
    byte[] b = xml.getBytes();
    // Set the appropriate HTTP parameters.
    httpConn.setRequestProperty( "Content-Length",String.valueOf( b.length ) );
    httpConn.setRequestProperty("Content-Type","text/xml; charset=utf-8");
    httpConn.setRequestMethod( "POST" );
    httpConn.setDoOutput(true);
    httpConn.setDoInput(true);
    httpConn.setAllowUserInteraction(true);
    httpConn.setDefaultUseCaches(false);
    httpConn.setUseCaches(false);
    OutputStream out = httpConn.getOutputStream();
    System.out.println("httpConn.getResponseCode():"+httpConn.getResponseCode());
    out.write( b );
    out.close();
    }The console is:
    httpConn.getResponseCode():401
    java.io.IOException: Server returned HTTP response code: 401 for URL: http://ADMIN:password@myserver/myservices/RequestWS
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection$3.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.net.www.protocol.http.HttpURLConnection.getChainedException(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
    at SOAPClient.main(SOAPClient.java:81)
    Caused by: java.io.IOException: Server returned HTTP response code: 401 for URL: http://ADMIN:password@myserver/myservices/RequestWS
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
    at java.net.HttpURLConnection.getResponseCode(Unknown Source)
    at SOAPClient.main(SOAPClient.java:74)
    Exception in thread "main"
    Please help.
    Thank you very much
    Edited by: mycoffee on Jun 8, 2010 10:27 AM
    Edited by: mycoffee on Jun 8, 2010 11:06 AM

    morgalr wrote:
    [Check this thread, it should answer your question.|http://forums.sun.com/thread.jspa?threadID=5247915]
    Thank for quick help. My mistake is the colon after "Authorization
    I removed it and I get another error now from 401, now I am getting 500 :D
    {code}String creds = "ADMIN:password";
    String encodeCreds = Base64.encode(creds.getBytes());
    httpConn.setRequestProperty("Authorization:", "Basic "+encodeCreds); {code}
    Edited by: mycoffee on Jun 8, 2010 12:35 PM
    Edited by: mycoffee on Jun 8, 2010 12:36 PM

  • Help with free unlock code

    I just purchased a 7290 that was supposed to be unlocked (apparently it is refurbished). It came from cingular originally. My carrier can't unlock it to work with their system. Can anyone help me with free unlock codes?

    Only your carrier can provide free unlock codes.
    If you contact Horizon below in my signature, they do so cheaply and reliably.
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • Help with new error code (-1)!

    Hi I am trying to update my iphone 4 to ios5. When it comes to the last stage, it shows this error of -1. I am unable to find any info related to this error code. Any help with this is highly appreciated! Many Thanks. Now the phone is unusable. Previously it showed several errors including 1600 series and they are all resolved. This is the last hudrle. Please Help!
    Thanks

    Like many I experienced some issues when updating to iOS 5 (on launch day). I finally gave up on the Update option and chose the Restore option.
    iOS 5 downloaded and installed without issue. I restored from Back Up and everything was in place. No errors.
    If you are updating, try using Restore instead.

  • Hi there can you help with this error code Oxc5d1281

    I refilled the HP cartridges in my Photosmart C 7250 All-in-One and put them in and got this error.  I have D/C power,etc and it still comes up with this error code.  Now what?
    Cheers,
    British_eh

    Hi british_eh
    You could try resetting the printer, details here
    Note though that the reliability of refills tends not be as good as originals, links below FYI.....
    http://h10025.www1.hp.com/ewfrf/wc/document?docname=c00853819&cc=us&dlc=en&lc=en&jumpid=reg_R1002_US...
    http://www.qualitylogic.com/2009HPinktest.pdf
    Kind Regards, Ciara
    Although I am an HP employee, I am speaking for myself and not for HP.
    Twitter: @Ciara_B_HP

  • Help with forwarding within a JSP

    Currently I am using the following to do a forward:
      RequestDispatcher rd = request.getRequestDispatcher("/login.jsp");
      rd.forward(request,response);However, I need the URL/URI to show up in the forward. So, let's say you visit http://www.whatever.com/whatever.jsp, and you do the RequestDispatcher in there to another JSP, it won't show that second file int he URL or URI.
    Is there a way to get it to forward, with params, in a GET fashion (as in method=GET)?

    I screwed up on the code blocks, sorry about that.
    I was reading in my JSP book from Oreilly, about some ora:redirect which may do what I want, but I can't seem to get it to redirect/forward with those params still.
    Anyone know what I can do to do what I posted in the first post?
    Thanks...

Maybe you are looking for

  • Imovie won't open my imovie project

    Hello, I was working on an imovie project when imovie kept crashing. So i backed up deleted imovie and reinstalled. Now it won't open up my .rcproject file. Nothing happens. is all my work lost? Also, when it was crashing some of my viedo clips were

  • Problem with EL evalulation when used to assign component ID in ui:repeat

    Hello everyone, I've a problem when I try to assign the ID of a component with an EL within an ui:repeat component, e.g.: 0 <ui:repeat value="#{dm.categories}" var="category"> 1      <rich:panel id="catPanel#{category.id}"> 2         .... 3       </r

  • Deleted the iPod Software Updater 2006-01-10

    My Ipod was not sync'ing any songs so i thought i was because of the iPod Software Updater 2006-01-10 so i deleted it thinking when i restore the ipod to it's factory setting it will install it again, but although when i restored the ipod the songs s

  • Short Close of PR

    Dear All, We want to allow buyer to short close Released PR. But not directly thru setting Closed indicator. So we have add field to Close PR Item and user has to enter reason to close. (in "Customer Tab" at item level). On save we are updating EBAN

  • Table staring changes to dispute cases

    Hi experts, What is the table that stores the changes to dispute cases? I need to build a report on how of fields change, and about how long do they stick in a parcular value. Regards, Mario.