Results 1 to 8 of 8
  1. #1
    Join Date
    Jan 2007
    Posts
    688

    jsp displays source code

    Some JSP pages display the source code. Some work and some don't even after recompiling apache with tomcat module and restarting jsp.

    -rw-r--r-- 1 user user 6.5K Mar 10 17:18 index.jsp

    Not sure where the jsp logs are, but there were no errors in the domlogs.

  2. #2
    Join Date
    Feb 2002
    Location
    New York, NY
    Posts
    4,618
    If some work and some don't, there must be a difference that is causing it. Does it work if you chmod the file to mode 755 (rwxr-xr-x)?
    Scott Burns, President
    BQ Internet Corporation
    Remote Rsync and FTP backup solutions
    *** http://www.bqbackup.com/ ***

  3. #3
    Join Date
    Jan 2007
    Posts
    688
    It does not work on 755.

  4. #4
    Join Date
    Jan 2007
    Posts
    688
    This is the entire index.jsp page

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <%@ page language="java" import="java.sql.*,javax.servlet.*,javax.servlet.http.*,java.lang.*,java.util.*,java.io.*, java.security.MessageDigest" %>
    <%@ page import="javax.servlet.*" %>
    <%@ page import="javax.servlet.http.*" %>
    <%@ page import="java.lang.String" %>
    
    <%
            String user_level        = (String)session.getValue("user_level");
    %>
    
    <html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
    
    <head>
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
    <meta name="description" content="description">
    <meta name="keywords" content="keywords"> 
    <meta name="author" content="author"> 
    <link rel="stylesheet" type="text/css" href="default.css" media="screen">
    <link rel="stylesheet" type="text/css" href="index.css" media="screen">
    <title>domain - Home</title>
    
    
    <link rel="shortcut icon" href="favicon.ico" >
    <script type="text/javascript" src="scripts/notes.js"></script>
    </head>
    
    <body>
    
    <div class="container">
    
        <div class="navigation">
    
            <div class="title">
                <div class="titleimg">
                <img src="image/domain.jpg" alt="domain Home">
                </div>    
            </div>        
                
            <a href="contact.jsp">Contact</a>
            <a href="myfood.jsp">MyFood</a>
            <a href="myangel.jsp">MyAngel</a>
            <a href="websys.jsp">WebSystem</a>
            <a href="myplace.jsp">MyPlace</a>
            <a href="index.jsp" id="here">Home</a>
            <div class="clearer"><span></span></div>
            
        </div>
        <div class="holder_top">
    <%
        if(user_level!=null)
            {    
            out.println("<h1><a href='logout.jsp'>Logout</a></h1>");
            }
        else 
            {
    %>        
        <form method=post action='logincheck.jsp'>
        <h4><a href='signup.jsp'>Sign-Up</a> or <a href="contact.jsp">Help</a></h4>
        <div id="submit"><input type='submit' value='Login' ></div>
        <h3>Password: <input type='password' name='ipw' size='10'></h3>        
        <h3>Username: <input type='text' name='iid' size='10'></h3>
        </form>        
    <%        
            }
    %>
    
        </div>
        <div class="v_tag_content"></div>
        <div class="holder">
            <div class="holder_left">
            <div class="about">
            <h1></h1>        
            <div class="about_content">        
        
            <p>This will be my experiment site for learning new web design skills. Links followed 
            by a <img src="image/externalLink0.gif" width="10"> will be external links and links underlined by <img src="image/underline5.gif"></img><img src="image/underline5.gif"></img><img src="image/underline5.gif"></img> will be <a href="index.jsp">internal links</a>.</p>
    
            </div>
            </div>
                <div class="ref">
                <h1></h1>
                    <div class="ref_content">
                            <div class="noteManuTop">
                                <table>    <tr id="tr1">
                                    <th class="td1">-#-</th>
                                    <th class="td2">Posted By</th>
                                    <th class="td3">Posted At</th>
                                    <th class="td4">Topic</th>
                                    <th class="td5"></th>
                                    </tr>
                                </table>
                            </div>
                    
                    <div class="note_list">
    <%
        try {
       Connection connection = null;
       Class.forName("org.gjt.mm.mysql.Driver").newInstance();
       connection = DriverManager.getConnection("jdbc:mysql://localhost/domain_log?user=domain_log&password=domain");
    //   Statement stmt = connection.createStatement();
       PreparedStatement stmt = connection.prepareStatement ("SELECT number, author, date, topic, note FROM notes ORDER BY number DESC");    
     
      ResultSet rset = stmt.executeQuery ();
    
          if (rset.next()) {
    %>
        <div id="noteMenu">
    
        <table>
        <tr>
             <td class="td1"><%= rset.getString(1) %></td>
             <td class="td2"><%= rset.getString(2) %></td>
             <td class="td3"><%= rset.getString(3) %></td>
             <td class="td4" title="<%= rset.getString(5)%>" ><%= rset.getString(4) %></td>
             <td class="td5">
                     
                     <input title="<%= rset.getString(5)%>" type="submit" value="Show" onclick="showNote();" />
             </td>
             
    
        </tr>
    
    <%    while (rset.next()) {
    %>
        <tr>
             <td class="td1"><%= rset.getString(1) %></td>
             <td class="td2"><%= rset.getString(2) %></td>
             <td class="td3"><%= rset.getString(3) %></td>
             <td class="td4"><%= rset.getString(4) %></td>
             <td class="td5">
                     
                     <input title="<%= rset.getString(5)%>" type="submit" value="Show" onclick="showNote();" />
             </td>
    
        </tr>
    
    <% }
    %>
          </table>
    <%  }
          else {
    %>
        <P> Sorry, the query returned no rows! </P>
    <%
          }
          rset.close();
          stmt.close();
        } catch (SQLException e) {
          out.println("<P>" + "There was an error doing the query:");
          out.println("<PRE>" + e + "</PRE> \n <P>");
        }
    %>
                        
                    
                    </div>
                    </div>
                    <div class="note_content"><div id="showNoteHere">Notes</div></div>
                    </div>
                </div>
            
            </div>
            
            <div class="holder_right">
            
            <div class="news">
        
            <h1></h1>
            <div class="news_content">
        
            <a href="#" class="imgsd"><img src="image/workout_log_263x52.gif" alt="" class="imgs"></a>
            <a href="#" class="imgsd"><img src="image/dive_log_263x52_b.gif" alt="" class="imgs"></a>
            <a href="#" class="imgsd"><img src="image/ton_ti_263x52.gif" alt="" class="imgs"></a>    
            
            </div><!-- end of news_content -->
            </div>
    <div class="sites">
    <h1></h1>
    <div class="sites_content">
    
    
        <div class="list">
        <ul>
            <li>
            <h2><a href="http://www.javascripttoolbox.com/">JavaScript Toolbox</a></h2>
            </li>
            <li>
            <h2><a href="http://www.w3schools.com/">W3 Schools</a></h2>
            </li>
            <li>
            <h2><a href="http://www.kaosweaver.com/">Dreamweaver Extensions by Kaosweaver</a></h2>
            </li>
            <li>
            <h2><a href="http://www.bobbyvandersluis.com/">bobbyvandersluis.com</a></h2>
            </li>
            <li>
            <h2><a href="http://www.1001freefonts.com/">1001freefonts.com</a></h2>
            </li>
            <li>
            <h2><a href="http://www.webdesignerwall.com/">webdesignerwall.com</a></h2>
            </li>
            <li>
            <h2><a href="http://www.csszengarden.com/">csszengarden</a></h2>
            </li>
            
            
        </ul>
        </div>
        </div>
    </div>        
            </div>
            
            
            
        </div>
    
        <div class="footer">
        <img src="/cgi-sys/Count.cgi?df=domainmain.dat|display=Date|dformat=MMDDYY|ft=2|md=6|frgb=100;100;255|dd=E" >
    <img src="/cgi-sys/Count.cgi?df=domainmain.dat|display=Clock|timezone=GMT-0500|tformat=12|ft=2|md=6|frgb=100;100;255|dd=E" >
    This page have been visited <img src="/cgi-sys/Count.cgi?df=domain.dat|display=Counter|ft=6|md=6|frgb=100;139;216|dd=E" > times.
    
        &copy; 2007 <a href="index.jsp">domain.com</a>. by <a href="index.jsp">Ares</a>
        </div>
    
    </div>
    
    </body>
    
    </html>

  5. #5
    Join Date
    Jan 2007
    Posts
    688
    Where are the logs for tomcat/jsp anyway?

  6. #6
    The location of the log files will depend on what type of server you have. Linux or FreeBSD. If Linux; Debian, RedHat, Suse...
    Enterprise IT Professional, Former Web Hosting Tech.

  7. #7
    Join Date
    Jan 2007
    Posts
    688
    I'm using Centos

  8. #8
    Check in.

    /usr/share/apache-tomcat-X.X/logs

    where X.X is the tomcat version number....
    Enterprise IT Professional, Former Web Hosting Tech.

Posting Permissions

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