JSP to PHP

I have a content management system that is currently all JSP. At login time, session variables are set (username, password, authority level).
Can and HOW do access JSP-set session varibles with PHP?
Thanks

Hi
The only way, as far as know, is to pass jsp variables encoded via post to your php routine and the start a new php session and set java variables as php variables:
<?
start_session();
if (isset($_POST['name']) && strlen($_POST['name'])) > 0) {
   $_SESSION['name'] = $_POST['name']);
?>Also, I know I've seen a java php section in php manuall, but I don't remember if there you will find the answer for your question...
Nevertheless, I think that java could do anything that php does and the best way will be translate your php routine to java... :)
Hope this helps
<xl>

Similar Messages

  • In Dreamweaver MySites[New Site] menu option , if I had a hosting JSP/PHP what I must declare the hosting JSP or PHP ?

    In Dreamweaver MySites[New Site] menu option , if I had a hosting JSP/PHP what I must declare the hosting JSP or PHP ?

    The simplest answer is to choose the language you work best with, and that fits the clients specification the best.
    I have mixed server languages on a site before, (would not recommend) when a client has decided they wish to change from their old one to a new(er) /different one, the only thing you must watch if doing this, is that you do not mix languages on the same page (will not work correctly, if at all), and parameter passing.
    PZ

  • JSP ASP PHP (and others)

    Does anyone know how many projects are implementing JSPs in comparison to those using .asp (and others)? I was just curious.. There's an "unfair" (I think) comparison (March 2002) here http://php.weblogs.com/popularity

    .ASP being the widest used. I think .jsp and .php are somewhere close to each other in the amount of projects out there.
    Hope this helps

  • JSP v PHP

    What is the difference, if any, between the abilities of JSP and PHP.
    Too many different technologies competing in the same space makes my head spin..

    PHP is more for dynamic content
    in websites, while JSP's and servlets are used in
    webbased applications built on top of Java.I disagree. If you use JSP tags, it's quite dynamic.
    One difference I'd like to point out is that JSP is based on Java and HTML, which are existing technologies you may already know. PHP is something new and you'd have to learn a new language/syntax. To me that's a real turn-off and I probably won't be using PHP anytime soon. I already use several languages and dozens of API's.

  • JSP and PHP ?!

              is it possible to include a php file into a JSP with the include tag?
              infos:
              the php file is on another server as the jsp file.
              the php server doens'nt support jsp and vice versa.
              hope anyone can help!!!!
              bye
              Phil
              

    Am I being an idiot or is there ever a reason for
    using JSP over PHP?A very large number of people have chosen to write their websites (or at least the user interface part) in JSP. They can't all be idiots.

  • Does apex support any server side JSP or PHP?

    I have the folowing script that is used to save flash files as images. I am hoping there is some way to make these serverside calls from within apex.
    <%@ page import="java.io.OutputStream"%>
    <%@ page import="java.awt.Color"%>
    <%@ page import="java.awt.Graphics"%>
    <%@ page import="java.awt.image.BufferedImage"%>
    <%@ page import="javax.imageio.ImageIO"%>
    <%
         //Decoded data from charts.
         String data="";
         //Rows of color values.
         String[] rows;
         //Width and height of chart.
         int width=0;
         int height=0;
         //Default background color of the chart
         String bgcolor="";
         Color bgColor;
         //Get the width and height from form
         try{
              width = Integer.parseInt(request.getParameter("width"));
              height = Integer.parseInt(request.getParameter("height"));     
         catch(Exception e){
              //If the width and height have not been given, we cannot create the image.
              out.print("Image width/height not provided.");
              out.close();
         if(width==0 || height==0){
              //If the width and height are less than 1, we cannot create the image.
              out.print("Image width/height not provided.");
              out.close();
         //Get background color from request and set default
         bgcolor =request.getParameter("bgcolor");
         if (bgcolor==null || bgcolor=="" || bgcolor==null){
                   bgcolor = "FFFFFF";
         //Convert background color to color object     
         bgColor = new Color(Integer.parseInt(bgcolor,16));
         //Get image data  from request
         data = request.getParameter("data");
         if(data==null){
              //If image data not provided.
              out.print("Image Data not supplied.");
              out.close();
         try{
              //Parse data
              rows = new String[height+1];
              rows = data.split(";");
              //Bitmap to store the chart.
              //Reference to graphics object - gr
              BufferedImage chart = new BufferedImage(width,height,BufferedImage.TYPE_3BYTE_BGR);
              Graphics gr = chart.createGraphics();
              gr.setColor(bgColor);
              gr.fillRect(0,0,width,height);     
              String c;
              int r;
              int ri = 0;
              for (int i=0; i<rows.length; i++){
                   //Split individual pixels.               
                   String[] pixels = rows.split(",");               
                   //Set horizontal row index to 0
                   ri = 0;
                   for (int j=0; j<pixels.length; j++){                    
                        //Now, if it's not empty, we process it                    
                        //Split the color and repeat factor
                        String[] clrs = pixels[j].split("_");     
                        //Reference to color
                        c = clrs[0];
                        r = Integer.parseInt(clrs[1]);
                        //If color is not empty (i.e. not background pixel)
                        if (c!=null && c.length()>0 && c!=""){          
                             if (c.length()<6){
                                  //If the hexadecimal code is less than 6 characters, pad with 0
                                  StringBuffer str = new StringBuffer(c);
                                  int strLength = str.length();
                                  for ( int p = c.length()+1; p <= 6 ; p ++ ) {
                                            str.insert( 0, "0" );
                                  //Assing the new padded string
                                  c = str.toString();
                             for (int k=1; k<=r; k++){     
                                  //Draw each pixel
                                  gr.setColor(new Color(Integer.parseInt(c,16)));
                                  gr.fillRect(ri, i,1,1);
                                  //Increment horizontal row count
                                  ri++;                              
                        }else{
                             //Just increment horizontal index
                             ri = ri + r;
              //Returns the image
              response.setContentType("image/jpeg");
              response.addHeader("Content-Disposition", "attachment; filename=\"FusionCharts.jpg\"");
              OutputStream os = response.getOutputStream();
              ImageIO.write(chart, "jpeg", os);
              os.close();
         }catch(Exception e){
              //IF the image data is mal-formatted.
              out.print("Image data is not in proper format.");
              out.close();
    %>

    NO, APEX does NOT support running jsp or PHP scripts..
    Thank you,
    Tony Miller
    Webster, TX

  • Passing values between jsp and php

    hi there, is it possible to pass values between jsp and
    php? i really need to find out the way if there is
    any. thanks in advance
    -azali-

    Yes, there are a few ways to do this.
    1) Think about using Cookies.
    2) Maybe use a Redirect passing the values in the Query string.
    3) Retain the data in a repository in the back end.
    4) Using Hidden fields within your pages.
    I am sure you can use these Idea's for a base to develop other methods on how to pass values back and forth from JSP -> PHP and vice versa.
    -Richard Burton

  • JSP versus PHP

    Is there anything JSP does better than PHP?

    PHP is a good scripting language, probably the best one. It does the same job as ASP only much better. I would suggest that JSP can actually do a whole lot more than that because you have the full functionality of the programming language behind it rather than being purely designed for web scripting. This gives flexibility and the jsp/servlet/bean architecture also offers far greater options for re-use and extension than php offers.

  • JSP inside PHP?

    Is it possible (with calculable effort) to integrate JSPs in a PHP driven web site? Or are Java experts kicked off that way?

    Hmm, this is becoming a little tougher. You can't really mix PHP and JSP code in the exact same file, because your webserver would send it off to either the JVM or the PHP interpreter and both are going to fail when reading the 'alien' code.
    I think you could use include tags in a JSP to place the PHP parts where you'd like to have them. I believe the PHP would be parsed before it is given to the JVM and then the result, which is common HTML, is inserted into the JSP page. That way you wouldn't need to rewrite any of the portions that are already available in PHP.
    Check out http://java.sun.com/webservices/docs/1.0/tutorial/doc/JSPIntro8.html for detailed information on including stuff in JSP pages...

  • JSP and PHP together?

    hi all,
    can we use an utility developed in php in our jsp web application.
    thanks
    yashvant

    Depends on the back end technology that u r using ...
    Read more and u will get it ...

  • What is jsp and php

    hi to all
    this might not the place to ask this question but i need someone to explain his thing once and for all
    what is jsp , what is it used for (please give relevant daily examples)
    what is php, what is it used for( please give relevant daily example)
    Thanks in advance for the help...

    > > i wanna ask again what is STFW ????
    >
    http://www.google.com/search?q=what+is+stfw
    Jeepers.
    ~

  • EJB+JSP versus PHP

    What is the advantage of using EJB+JSP for a web ticket selling application instead of using PHP?
    Can Java support more customer hits compare to PHP?
    Is EJB+JSP better than PHP? Why?

    I know both PHP and Java. PHP is a more rapid development tool than Java. Once you know it, it is just easier to make simple pages out of it vs Java. In some ways PHP is easier to develop in and in some ways it is harder.
    There is no real IDE for PHP. There are some tools for real time syntax checking (Komodo) and debugging, but they are not as mature as the pick of current Java IDE's.
    In reverse, there is never a need to restart a server when updating a php file unlike Java. This is not a problem with JSP's, but when you change servlets the server will unload all classes from memory and reload. This is a major pain if you are working on a production server.
    I have created a game clan site with many functions using PHP and an order processing section of someones web site. It is fine for smaller projects and is very fast to develop in, however PHP does not scale as well as Java. A large enterprise system is better suited to using Java.
    Also, PHP is a loosely typed language. This has many nuances that are different from a strongly typed language like java. OOP is definately not as powerful in PHP, as there is no private, protected and public typing of methods and fields. You can make classes and even extend classes, but it is poorly implimented IMO. I did all my PHP OOP style, but did not use any inheritance. The limitations of OOP principles is probably the most restrictive aspect of PHP that I can see.

  • From PHP to JSP for a search-responder.php

    I have been asked to use the "search-as-you-type" solution offered up by Google at [http://code.google.com/p/search-as-you-type/|http://code.google.com/p/search-as-you-type/]. The documentation offered by Google is pretty much straight forward but of course the actual piece of code that gets the data is built in PHP and my client needs this to be used on a page serving up JSP.
    I am learning JSP and moving from PHP and ASP and learning quickly but not quick enough to finish the project.
    Would anyone be able and willing to help me convert the functions in the following PHP code into JSP?
    Thanks in advance to anyone who takes the time to help me.
    <?php
    * Copyright (C) 2006 Google Inc.
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
    *      http://www.apache.org/licenses/LICENSE-2.0
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    * See the License for the specific language governing permissions and
    * limitations under the License.
    * Search-as-you-type sample Ajax responder
      // Adding a cache control so that browsers won't cache Ajax requests
      header("Cache-Control: no-cache");
      header("Content-Type: text/html; charset=UTF-8");
       * Get the sample data from the text file.
       * @return array Loaded data
      function GetData() {
        $data = array();
        $file = file("test-data.txt");
        foreach($file as $record) {
          $record = explode("|", trim($record));
          if (count($record) == 4) { // Ignore invalid lines
            $data[] = $record;
        return $data;
       * Get the results based on user's query.
       * @param string $query Query
       * @param array $data Sample data
       * @return array Result array
      function GetResults($query, $data) {
        $results = array();
        $queryLength = strlen($query);
        foreach ($data as $record) {
          if (substr(strtolower($record[0]), 0, $queryLength) == $query) {
            $result = array();
            $result['name'] = $record[0];
            $result['type'] = $record[1];
            $result['content'] = $record[2];
            $result['moreDetailsUrl'] = $record[3];
            $result['style'] =
              ($query == strtolower($record[0])) ? 'expanded' : 'normal';
            $results[] = $result;
        return $results;
      // Get the data and the query
      $data = GetData();
      $query = strtolower(ltrim($_GET['query']));
      // Build response
      $response = array();
      $response['query'] = $query;
      $response['results'] = GetResults($query, $data);
      if (count($response['results']) == 1) {
        $response['autocompletedQuery'] = $response['results'][0]['name'];
      // Output response
      echo "searchAsYouType.handleAjaxResponse(";
      echo json_encode($response);
      echo ");";
    ?>

    Thanks for your comment Gimbal2.
    I have already been thoroughly surprised at how different JSP is from PHP. I am finding quite hard to wrap my head around the whole process to be honest.
    I am beginning to see that JSP and PHP work in a totally different way than each other.
    I am not technically trying to translate or convert the PHP file as much as I am trying to build a file in JSP that does the same functions. The main functions of the PHP script are commented by Google and should be easily enough re-written in JSP in order to produce similar results.
    Since the output needs to be in a JSON format when passed to the .js file you'd think this would be better suited as a .jsp file as well or even a JAVA Applet, Servlet or even a bean. Since the whole site is already built in JSP for a multitude of other functions it seems likely that adding on more to read data from a source file and send it back to the .JS would be straight forward, but I could be wrong. But again I am not familiar enough with JAVA or JSP (yet) to make heads or tails of this.
    1. // Adding a cache control so that browsers won't cache Ajax requests
    2. * Get the sample data from the text file. @return array Loaded data
    3. * Get the results based on user's query.
    * @param string $query Query
    * @param array $data Sample data
    * @return array Result array
    4. // Get the data and the query
    5. // Build response
    6. // Output response

  • Tomcat JSP & PHP

    I've installed Tomcat 4.0.1 I'd like to attach also PHP. Is it possible. Does anybody know this way? And is it possible to mix JSP with PHP
    <%
    out.print("Test");
    %>
    <?php
    echo "Test";
    ?>

    In theory, you should be able to use both technologies on the same page, whenever you can solve some configuration issues like file extension assigning, e.g: if you have a .php file, how can you run the jsp inside? you need to make some kind of "neutral" extension and refine your server to send to each server its own code.
    I�m trying to do it on windows 2000 (IIS 5.0), but haven�t still figured out how.

  • JSP , PHP, ASP???

    i read somewhere that php is far more powerful than JSP and PHP? is that rue??
    also for which is finding hosting, cheaper and easier???
    Ali

    PHP more powerful? Depends on what you mean by power.
    In terms of features, no. JSP and ASP have many more features. They have full fledged OO programming languages and API libraries backing them up.
    In terms of speed, it can be faster, just BECAUSE it doesn't have to bother with all the features that JSP/ASP provide.
    In terms of memory requirements, PHP wins hands down. Java/ASP can be quite memory hungry.
    They all do basically the same stuff at the end of the day - generate dynamic web pages.
    For a lot of simple small-medium size websites PHP is perfectly fine.
    ASP and .NET can provide many more features, but you are tied to MIcrosoft platforms.
    Java/JSP is the best (of course - how can I say other on a java forum) - provides a good balance of speed/power without tying you down to a specific platform
    You will probably find hosting easier for PHP/MySQL than you will for the other technologies, though I can't say with any certainty. I haven't really looked myself :-)
    Cheers.
    evnafets
    (let the flames begin)

Maybe you are looking for

  • How do i transfer photos from phone to Mac Book Pro?

    wut Do i do once i hook up my phone to my computer? AND I hate that the back space key is to close to the POWER Key. Hit it constantly and it will shut me down Right in the middle of important tasks

  • Preview app not responding after having multiple images open

    Several images were opened using the preview app, the app stopped responding and I can't send the images to either iphoto or even delete the images. I can force quit the program but evertime I open an image the preview app opens and stops responding.

  • Disable custom field in SRM SUS in PO / POR item level

    HI all, We are using SRM 5.0, ECC6.0 and ECS scenario. We have a requirement where a custom field in SUS portal has to be disabled for a certain condition. I have checked for BADIs which could help me achieve this but none are available. BADIs such a

  • 46YL863: Changing TV channels - delay before new picture appears

    Hope someone can advise me please on an 'issue' that's recently arisen with my 46YL863 TV. I say 'issue' rather than problem in case it's something to do with my settings that is causing this. When I change TV channels I'm noticing that there is a se

  • Contract Management 14 SP3

    Good day all, I have a CM14.0.2.4 system I've applied SP 3 to, I'm getting a high CPU usage on from the end user systems when once the user logs into CM, 90 to 100% until CM or IE is closed.  In checking Task Manager, I find Java and IE each grabbing