You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Anne-Marie Ternes <An...@cie.etat.lu> on 2001/04/10 15:00:21 UTC

files included in httpd.conf (problem 1)

Hi,

I've got a small problem here concerning which files I have to include
in the httpd.conf file.
I thought that the jserv.conf file didn't need to be included any longer
in httpd.conf. So I only included the tomcat-apache.conf file. If I do
that, Tomcat starts up allright, but Apache gives me this error during
startup:

----
You must specify a secret key, or disable this feature.
To disable, add "ApJServSecretKey DISABLED" to your Apache configuration
file.
To use, add "ApJServSecretKey {filename}" where filename is document
with more or less random contents, and perhaps a few kb in length.
The Apache JServ documentation explains this in more detail.
/oas/oashome/Apache/Apache/bin/httpdsctl start: httpd could not be
started
----

This, although there is a correct line ApJServSecretKey DISABLED in my
tomcat-apache.conf.

What do I miss here?

Then I tried to include both jserv.conf and tomcat-apache.conf, but then
I get an error of ApJServ directives being defined several times. What I
did was to copy the tomcat-apache.conf file, cut out its ApJServ
directives and include that file in httpd.conf. There's no errors
anymore, but I'm still not sure if Apache really hands servlets and JSP
over to Tomcat.

I'm still able to call servlets through the Apache URL (7777), JSPs thru
Apache don't work anymore. On Tomcat (8080), servlets and JSP work also.

But I thought that, for example, a servlet called through the standard
Apache URL should automatically be handed over to Tomcat, which doesn't
seem to be the case.
How can I find out if the servlet I see in my browser was handled by
Tomcat or Apache?

Thank you to anybody helping me on these configuration issues!

Anne-Marie
--
=====================================
Anne-Marie Ternes

Informaticien diplômé

Centre Informatique de l'Etat
B.P. 1111
L-1011 Luxembourg

Tél: 49 925 642
E-Mail: anne-marie.ternes@cie.etat.lu
=====================================



Re: please advise me here

Posted by Ying Sun <Yi...@Cylogix.com>.
thank you very much.
I tried to change getID to getId,setID to setId and also the change ID to id in jsp
file,it still act same.But if I change <jsp:getProperty name="faq" property="id"> to

<%= faq.getId()  %>.It work.
so I wonder where's the problem.


Anne-Marie Ternes wrote:

> Hi,
>
> try changing "ID" to "Id". The thing is that following JavaBeans specification,
> only the first letter of the variable has to be capitalized.
> For example:
> If your bean has a variable "question", the setter method will be "setQuestion",
> the getter method will be "getQuestion", i.e. the first letter of your variable
> "question" is turned into a capital letter
>
> So, following the same rules, if your variable is "id", the set and get methods
> must be "setId" and "getId".
>
> HTH
>
> Anne-Marie
>
> Ying Sun wrote:
>
> > Hi all,
> > I happened to a strange problems.
> > The command prompt window display every bean id and question as expected from
> > database.
> > but the <jsp:getProperty name="faq" property="ID">
> >            <jsp:getProperty name="faq" property="question"> doesn't work,
> > it suppose look like
> > id       question
> > 1        what's this
> > 2       what's that
> >
> > but now it look like
> > id
> > 0
> > 0
> >
> > and also the bean property is id,why we need to put ID in <jsp:getProperty
> > name="faq" property="ID"> .
> >
> > thank you all in advance
> >
> > <%@ page import="com.taglib.wdjsp.faqtool.*"
> > errorPage="error.jsp" %>
> > <jsp:useBean id="faq" class="com.taglib.wdjsp.faqtool.FaqBean"/>
> > <%
> >   FaqBean[] faqs = (FaqBean[])request.getAttribute("faqs");
> > %>
> > <html>
> > <head><title>Update Menu</title></head>
> > <form name="menu" action="/webdev/servlet/FaqAdminServlet" method="post">
> > <table border="1" align="center"><tr><td>
> > <table bgcolor="tan" border="1" align="center" cellpadding="10"
> > cellspacing="0">
> > <tr><th colspan="2">FAQ Administration: Update Menu</th></tr>
> > <%
> > for (int i=0; i < faqs.length; i++) {
> >   faq = faqs[i];
> > %>
> > <% System.out.println(faq.getID()); %>
> > <% System.out.println(faq.getQuestion()); %>
> > <tr>
> > <td><input type="radio" name="id" value="<jsp:getProperty name="faq"
> > property="ID"/>">
> > <jsp:getProperty name="faq" property="ID"/></td>
> > <td><jsp:getProperty name="faq" property="question"/></td>
> > </tr>
> > <% } %>
> > <tr><td colspan=2 align="center">
> > <input type="submit" value="Abort Updating">
> > <input type="submit" value="Update Selected FAQ"
> > onClick="document.menu.cmd.value='update'">
> > </td></tr>
> > </table>
> > </td></tr></table>
> > <input type="hidden" name="cmd" value="abort">
> > </form>
> > </html>
> >
> > package com.taglib.wdjsp.faqtool;
> >
> > import java.util.Date;
> >
> > public class FaqBean {
> >   private int id;
> >   private String question;
> >   private String answer;
> >   private Date lastModified;
> >
> >   public FaqBean() {
> >     this.id = 0;
> >     this.question = "";
> >     this.answer = "";
> >     this.lastModified = new Date();
> >   }
> >
> >   public void setQuestion(String question) {
> >     this.question = question;
> >     this.lastModified = new Date();
> >   }
> >
> >   public String getQuestion() {
> >     return this.question;
> >   }
> >
> >   public void setAnswer(String answer) {
> >     this.answer = answer;
> >     this.lastModified = new Date();
> >   }
> >
> >   public String getAnswer() {
> >     return this.answer;
> >   }
> >
> >   public void setID(int id) {
> >     this.id = id;
> >   }
> >
> >   public int getID() {
> >     return this.id;
> >   }
> >
> >   public Date getLastModified() {
> >     return this.lastModified;
> >   }
> >
> >   public void setLastModified(Date modified) {
> >     this.lastModified = modified;
> >   }
> >
> >   public String toString() {
> >     return "[" + id + "] " + "Q: " + question + "; A: " +
> >       answer + "\n";
> >   }
> > }
>
> --
> =====================================
> Anne-Marie Ternes
>
> Informaticien diplômé
>
> Centre Informatique de l'Etat
> B.P. 1111
> L-1011 Luxembourg
>
> Tél: 49 925 642
> E-Mail: anne-marie.ternes@cie.etat.lu
> =====================================


Re: please advise me here

Posted by Anne-Marie Ternes <An...@cie.etat.lu>.
Hi,

try changing "ID" to "Id". The thing is that following JavaBeans specification,
only the first letter of the variable has to be capitalized.
For example:
If your bean has a variable "question", the setter method will be "setQuestion",
the getter method will be "getQuestion", i.e. the first letter of your variable
"question" is turned into a capital letter

So, following the same rules, if your variable is "id", the set and get methods
must be "setId" and "getId".

HTH

Anne-Marie

Ying Sun wrote:

> Hi all,
> I happened to a strange problems.
> The command prompt window display every bean id and question as expected from
> database.
> but the <jsp:getProperty name="faq" property="ID">
>            <jsp:getProperty name="faq" property="question"> doesn't work,
> it suppose look like
> id       question
> 1        what's this
> 2       what's that
>
> but now it look like
> id
> 0
> 0
>
> and also the bean property is id,why we need to put ID in <jsp:getProperty
> name="faq" property="ID"> .
>
> thank you all in advance
>
> <%@ page import="com.taglib.wdjsp.faqtool.*"
> errorPage="error.jsp" %>
> <jsp:useBean id="faq" class="com.taglib.wdjsp.faqtool.FaqBean"/>
> <%
>   FaqBean[] faqs = (FaqBean[])request.getAttribute("faqs");
> %>
> <html>
> <head><title>Update Menu</title></head>
> <form name="menu" action="/webdev/servlet/FaqAdminServlet" method="post">
> <table border="1" align="center"><tr><td>
> <table bgcolor="tan" border="1" align="center" cellpadding="10"
> cellspacing="0">
> <tr><th colspan="2">FAQ Administration: Update Menu</th></tr>
> <%
> for (int i=0; i < faqs.length; i++) {
>   faq = faqs[i];
> %>
> <% System.out.println(faq.getID()); %>
> <% System.out.println(faq.getQuestion()); %>
> <tr>
> <td><input type="radio" name="id" value="<jsp:getProperty name="faq"
> property="ID"/>">
> <jsp:getProperty name="faq" property="ID"/></td>
> <td><jsp:getProperty name="faq" property="question"/></td>
> </tr>
> <% } %>
> <tr><td colspan=2 align="center">
> <input type="submit" value="Abort Updating">
> <input type="submit" value="Update Selected FAQ"
> onClick="document.menu.cmd.value='update'">
> </td></tr>
> </table>
> </td></tr></table>
> <input type="hidden" name="cmd" value="abort">
> </form>
> </html>
>
> package com.taglib.wdjsp.faqtool;
>
> import java.util.Date;
>
> public class FaqBean {
>   private int id;
>   private String question;
>   private String answer;
>   private Date lastModified;
>
>   public FaqBean() {
>     this.id = 0;
>     this.question = "";
>     this.answer = "";
>     this.lastModified = new Date();
>   }
>
>   public void setQuestion(String question) {
>     this.question = question;
>     this.lastModified = new Date();
>   }
>
>   public String getQuestion() {
>     return this.question;
>   }
>
>   public void setAnswer(String answer) {
>     this.answer = answer;
>     this.lastModified = new Date();
>   }
>
>   public String getAnswer() {
>     return this.answer;
>   }
>
>   public void setID(int id) {
>     this.id = id;
>   }
>
>   public int getID() {
>     return this.id;
>   }
>
>   public Date getLastModified() {
>     return this.lastModified;
>   }
>
>   public void setLastModified(Date modified) {
>     this.lastModified = modified;
>   }
>
>   public String toString() {
>     return "[" + id + "] " + "Q: " + question + "; A: " +
>       answer + "\n";
>   }
> }

--
=====================================
Anne-Marie Ternes

Informaticien diplômé

Centre Informatique de l'Etat
B.P. 1111
L-1011 Luxembourg

Tél: 49 925 642
E-Mail: anne-marie.ternes@cie.etat.lu
=====================================



Re:please advise me here

Posted by Ying Sun <Yi...@Cylogix.com>.
Hi all,
I happened to a strange problems.
The command prompt window display every bean id and question as expected from
database.
but the <jsp:getProperty name="faq" property="ID">
           <jsp:getProperty name="faq" property="question"> doesn't work,
it suppose look like
id       question
1        what's this
2       what's that

but now it look like
id
0
0

and also the bean property is id,why we need to put ID in <jsp:getProperty
name="faq" property="ID"> .

thank you all in advance

<%@ page import="com.taglib.wdjsp.faqtool.*"
errorPage="error.jsp" %>
<jsp:useBean id="faq" class="com.taglib.wdjsp.faqtool.FaqBean"/>
<%
  FaqBean[] faqs = (FaqBean[])request.getAttribute("faqs");
%>
<html>
<head><title>Update Menu</title></head>
<form name="menu" action="/webdev/servlet/FaqAdminServlet" method="post">
<table border="1" align="center"><tr><td>
<table bgcolor="tan" border="1" align="center" cellpadding="10"
cellspacing="0">
<tr><th colspan="2">FAQ Administration: Update Menu</th></tr>
<%
for (int i=0; i < faqs.length; i++) {
  faq = faqs[i];
%>
<% System.out.println(faq.getID()); %>
<% System.out.println(faq.getQuestion()); %>
<tr>
<td><input type="radio" name="id" value="<jsp:getProperty name="faq"
property="ID"/>">
<jsp:getProperty name="faq" property="ID"/></td>
<td><jsp:getProperty name="faq" property="question"/></td>
</tr>
<% } %>
<tr><td colspan=2 align="center">
<input type="submit" value="Abort Updating">
<input type="submit" value="Update Selected FAQ"
onClick="document.menu.cmd.value='update'">
</td></tr>
</table>
</td></tr></table>
<input type="hidden" name="cmd" value="abort">
</form>
</html>

package com.taglib.wdjsp.faqtool;

import java.util.Date;

public class FaqBean {
  private int id;
  private String question;
  private String answer;
  private Date lastModified;

  public FaqBean() {
    this.id = 0;
    this.question = "";
    this.answer = "";
    this.lastModified = new Date();
  }

  public void setQuestion(String question) {
    this.question = question;
    this.lastModified = new Date();
  }

  public String getQuestion() {
    return this.question;
  }

  public void setAnswer(String answer) {
    this.answer = answer;
    this.lastModified = new Date();
  }

  public String getAnswer() {
    return this.answer;
  }

  public void setID(int id) {
    this.id = id;
  }

  public int getID() {
    return this.id;
  }

  public Date getLastModified() {
    return this.lastModified;
  }

  public void setLastModified(Date modified) {
    this.lastModified = modified;
  }

  public String toString() {
    return "[" + id + "] " + "Q: " + question + "; A: " +
      answer + "\n";
  }
}



Re: files included in httpd.conf (problem 1)

Posted by Anne-Marie Ternes <An...@cie.etat.lu>.
Hi all,

the problem with my config files seems now to be solved. So now in
httpd.conf I no more include the jserv.conf file. The problem with the
SecretKey thing was solved by copying tomcat-apache.conf to
my-tomcat-apache.conf, ant taking the LoadModule first line out of it. So I
now include only the my-tomcat-apache.conf file in httpd.conf.

I tried to comment out the LoadModule line in tomcat.conf, hoping that it
wouldn't be generated into the tomcat-apache file, but it still does. So
there seems still to remain some fumbling around with my own
tomcat-apache.conf file.

Now, also the redirection from Apache to Tomcat for servlets and JSP works
fine.

Anne-Marie

Saurabh Shukla wrote:

> in your tomcat-apache.conf check the entry for ApJservSecretKey.
>
> tomcat-apache.conf is generated by tomcat, so a better way is to save
> tomcat-apache.conf with a different name and include it in your
> httpd.conf(apache's configuration file).
>
> -----Original Message-----
> From: Anne-Marie Ternes [mailto:Anne-Marie.Ternes@cie.etat.lu]
> Sent: Tuesday, April 10, 2001 6:30 PM
> To: Tomcat Mailing List
> Subject: files included in httpd.conf (problem 1)
>
> Hi,
>
> I've got a small problem here concerning which files I have to include
> in the httpd.conf file.
> I thought that the jserv.conf file didn't need to be included any longer
> in httpd.conf. So I only included the tomcat-apache.conf file. If I do
> that, Tomcat starts up allright, but Apache gives me this error during
> startup:
>
> ----
> You must specify a secret key, or disable this feature.
> To disable, add "ApJServSecretKey DISABLED" to your Apache configuration
> file.
> To use, add "ApJServSecretKey {filename}" where filename is document
> with more or less random contents, and perhaps a few kb in length.
> The Apache JServ documentation explains this in more detail.
> /oas/oashome/Apache/Apache/bin/httpdsctl start: httpd could not be
> started
> ----
>
> This, although there is a correct line ApJServSecretKey DISABLED in my
> tomcat-apache.conf.
>
> What do I miss here?
>
> Then I tried to include both jserv.conf and tomcat-apache.conf, but then
> I get an error of ApJServ directives being defined several times. What I
> did was to copy the tomcat-apache.conf file, cut out its ApJServ
> directives and include that file in httpd.conf. There's no errors
> anymore, but I'm still not sure if Apache really hands servlets and JSP
> over to Tomcat.
>
> I'm still able to call servlets through the Apache URL (7777), JSPs thru
> Apache don't work anymore. On Tomcat (8080), servlets and JSP work also.
>
> But I thought that, for example, a servlet called through the standard
> Apache URL should automatically be handed over to Tomcat, which doesn't
> seem to be the case.
> How can I find out if the servlet I see in my browser was handled by
> Tomcat or Apache?
>
> Thank you to anybody helping me on these configuration issues!
>
> Anne-Marie
> --
> =====================================
> Anne-Marie Ternes
>
> Informaticien diplômé
>
> Centre Informatique de l'Etat
> B.P. 1111
> L-1011 Luxembourg
>
> Tél: 49 925 642
> E-Mail: anne-marie.ternes@cie.etat.lu
> =====================================

--
=====================================
Anne-Marie Ternes

Informaticien diplômé

Centre Informatique de l'Etat
B.P. 1111
L-1011 Luxembourg

Tél: 49 925 642
E-Mail: anne-marie.ternes@cie.etat.lu
=====================================



Re: files included in httpd.conf (problem 1)

Posted by Anne-Marie Ternes <An...@cie.etat.lu>.

Saurabh Shukla wrote:

> in your tomcat-apache.conf check the entry for ApJservSecretKey.
>

It is correct. It says:
ApJServSecretKey DISABLED

>
> tomcat-apache.conf is generated by tomcat, so a better way is to save
> tomcat-apache.conf with a different name and include it in your
> httpd.conf(apache's configuration file).
>

That's what I already did before.
am

>
> -----Original Message-----
> From: Anne-Marie Ternes [mailto:Anne-Marie.Ternes@cie.etat.lu]
> Sent: Tuesday, April 10, 2001 6:30 PM
> To: Tomcat Mailing List
> Subject: files included in httpd.conf (problem 1)
>
> Hi,
>
> I've got a small problem here concerning which files I have to include
> in the httpd.conf file.
> I thought that the jserv.conf file didn't need to be included any longer
> in httpd.conf. So I only included the tomcat-apache.conf file. If I do
> that, Tomcat starts up allright, but Apache gives me this error during
> startup:
>
> ----
> You must specify a secret key, or disable this feature.
> To disable, add "ApJServSecretKey DISABLED" to your Apache configuration
> file.
> To use, add "ApJServSecretKey {filename}" where filename is document
> with more or less random contents, and perhaps a few kb in length.
> The Apache JServ documentation explains this in more detail.
> /oas/oashome/Apache/Apache/bin/httpdsctl start: httpd could not be
> started
> ----
>
> This, although there is a correct line ApJServSecretKey DISABLED in my
> tomcat-apache.conf.
>
> What do I miss here?
>
> Then I tried to include both jserv.conf and tomcat-apache.conf, but then
> I get an error of ApJServ directives being defined several times. What I
> did was to copy the tomcat-apache.conf file, cut out its ApJServ
> directives and include that file in httpd.conf. There's no errors
> anymore, but I'm still not sure if Apache really hands servlets and JSP
> over to Tomcat.
>
> I'm still able to call servlets through the Apache URL (7777), JSPs thru
> Apache don't work anymore. On Tomcat (8080), servlets and JSP work also.
>
> But I thought that, for example, a servlet called through the standard
> Apache URL should automatically be handed over to Tomcat, which doesn't
> seem to be the case.
> How can I find out if the servlet I see in my browser was handled by
> Tomcat or Apache?
>
> Thank you to anybody helping me on these configuration issues!
>
> Anne-Marie
> --
> =====================================
> Anne-Marie Ternes
>
> Informaticien diplômé
>
> Centre Informatique de l'Etat
> B.P. 1111
> L-1011 Luxembourg
>
> Tél: 49 925 642
> E-Mail: anne-marie.ternes@cie.etat.lu
> =====================================

--
=====================================
Anne-Marie Ternes

Informaticien diplômé

Centre Informatique de l'Etat
B.P. 1111
L-1011 Luxembourg

Tél: 49 925 642
E-Mail: anne-marie.ternes@cie.etat.lu
=====================================



RE: files included in httpd.conf (problem 1)

Posted by Saurabh Shukla <sa...@cysphere.com>.
in your tomcat-apache.conf check the entry for ApJservSecretKey.

tomcat-apache.conf is generated by tomcat, so a better way is to save
tomcat-apache.conf with a different name and include it in your
httpd.conf(apache's configuration file).

-----Original Message-----
From: Anne-Marie Ternes [mailto:Anne-Marie.Ternes@cie.etat.lu]
Sent: Tuesday, April 10, 2001 6:30 PM
To: Tomcat Mailing List
Subject: files included in httpd.conf (problem 1)


Hi,

I've got a small problem here concerning which files I have to include
in the httpd.conf file.
I thought that the jserv.conf file didn't need to be included any longer
in httpd.conf. So I only included the tomcat-apache.conf file. If I do
that, Tomcat starts up allright, but Apache gives me this error during
startup:

----
You must specify a secret key, or disable this feature.
To disable, add "ApJServSecretKey DISABLED" to your Apache configuration
file.
To use, add "ApJServSecretKey {filename}" where filename is document
with more or less random contents, and perhaps a few kb in length.
The Apache JServ documentation explains this in more detail.
/oas/oashome/Apache/Apache/bin/httpdsctl start: httpd could not be
started
----

This, although there is a correct line ApJServSecretKey DISABLED in my
tomcat-apache.conf.

What do I miss here?

Then I tried to include both jserv.conf and tomcat-apache.conf, but then
I get an error of ApJServ directives being defined several times. What I
did was to copy the tomcat-apache.conf file, cut out its ApJServ
directives and include that file in httpd.conf. There's no errors
anymore, but I'm still not sure if Apache really hands servlets and JSP
over to Tomcat.

I'm still able to call servlets through the Apache URL (7777), JSPs thru
Apache don't work anymore. On Tomcat (8080), servlets and JSP work also.

But I thought that, for example, a servlet called through the standard
Apache URL should automatically be handed over to Tomcat, which doesn't
seem to be the case.
How can I find out if the servlet I see in my browser was handled by
Tomcat or Apache?

Thank you to anybody helping me on these configuration issues!

Anne-Marie
--
=====================================
Anne-Marie Ternes

Informaticien diplômé

Centre Informatique de l'Etat
B.P. 1111
L-1011 Luxembourg

Tél: 49 925 642
E-Mail: anne-marie.ternes@cie.etat.lu
=====================================