www.webdeveloper.com
Results 1 to 6 of 6

Thread: running BOTH php and jsp on apache 2.2

Hybrid View

  1. #1
    Join Date
    Dec 2010
    Posts
    30

    running BOTH php and jsp on apache 2.2

    Hi

    I currently have apache 2.2 running php files. I am trying to add a jsp file, but when i run the jsp file from the apache server, I just the the text of the script. I am trying to make apache have access to both php and jsp files. I read online that I need to download tomcat and a tomcat connector. I tried doing that but I couldn't figure out how to make it work. Has anyone had this issue before and been able to fix it? Also, I realize that even if I can get this working, when I try to run it on a server online, It might not be configured the same way, does anyone have any suggestions on how I can be able to test my code and not have compatibility problems when I try to upload it to an online server?

    Thanks

  2. #2
    Join Date
    Jan 2009
    Posts
    3,346
    You'll need a jsp container such as tomcat.

    As a side note there is usually not a very good reason to combine both within the same application.

  3. #3
    Join Date
    Dec 2010
    Posts
    30
    I can't figure out how to link tomcat to my apache. can anyone help with that?

    I am designing my website using javascript and using php to get to a mysql database. How would you suggest doing that?

    thanks

  4. #4
    Join Date
    Jan 2009
    Posts
    3,346
    Quote Originally Posted by alfehaieotasdh View Post
    I can't figure out how to link tomcat to my apache. can anyone help with that?

    I am designing my website using javascript and using php to get to a mysql database. How would you suggest doing that?

    thanks
    JSP is not the same as javascript. Are you sure you need to run JSP pages?

  5. #5
    Join Date
    Dec 2010
    Posts
    30
    hmm i'm not sure.

    My jsp page sets up my html setup and has javascript scripts that run when the site is loaded. I don't really know if there is any other way to do that. Here's the code from my jsp page. sorry its sloppy.

    thanks!

    Code:
    <html>
    <head>
    
    <title>...</title>
    
    <link media="all" type="text/css" href="main.css" rel="stylesheet"></link>
    
    
    
    <script language="javascript">
    function second() {
    user="Guest";
    getCurrenttopic();
    
    }
    </script>
    
    
    
    
    <script language="javascript">
    
    function AddOnLoad(myfunc) {
    	if(window.addEventListener)
    		window.addEventListener('load', myfunc, false);
    	else if(window.attachEvent)
    		window.attachEvent('onload', myfunc);
    }
    AddOnLoad(second);
    
    </script>
    
    
    
    </head>
    
    <body onload="" onunload="unloading();">
    <script type="text/javascript" src="getData.js"></script>
    <script type="text/javascript" src="globalvars.js"></script>
    <script type="text/php" src="insert.php"></script>
    <div>
    	<div class="mainHeader">
    
    		<tr height="150">
    			<td colspan="2" valign="top">
    			<img src= /logo.jpg />
    			</td>
    		</tr>
    
    	
    		<div id="smallMenu">
    			<ul>
    	
    				<li><div class="floatright">Welcome</div></li>
    	
    				<li><br /></li>
    				<li><div id="viewprofile">View Profile</div></li>
    			</ul>
    		</div>
    
    		<br />
    
    	</div>
    </div>
    
    
    <div id="wrapperDiv">
    
    	<div id="topic"></div>
    	<div id="contents"></div>
    </div>
    
     
    
    </body>
    </html>

  6. #6
    Join Date
    Jan 2009
    Posts
    3,346
    Rename that page to php then and don't worry about the jsp container. There is no JSP code in there based on what you posted.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles