3 Replies Latest reply: Mar 30, 2012 6:53 AM by gimbal2 RSS

    title issue in jsp

    708544
      I am writing html code in JSP. My jsp includes only below two lines.

      <jsp:useBean id="htmlCodeString" class="java.lang.String" scope="request" />
      <%=htmlCodeString%>

      htmlCodeString is html code being generated in java code and includes all the html tags.
      I have included <title> tag inside the <head> tag as well while generating htmlCodeString. But the the problem is it is not displaying title as set instead displaying url only. But if I see the view source of the same it shows the title.
        • 1. Re: title issue in jsp
          gimbal2
          Yes you're outputting the HTML content through JSP, but that does not make it a JSP question, its still a HTML one. You're doing something wrong. Forgot a quote somewhere, not properly closing a tag, whatever. Generally the "view source" of Firefox already passes out hints what can be wrong because the coloring doesn't match up.

          The thread has a big chance of being locked for being off-topic, but in the off-chance that it doesn't happen you should post the HTML source if you want more help. Be sure to post it between \
           tags, or else it will be unreadable.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
          • 2. Re: title issue in jsp
            708544
            <?xml version="1.0" encoding="UTF-8"?><html xmlns="http://www.w3.org/1999/xhtml"><head>
            <title>Demo of attribute-set</title>
            <style>
            @page{
            margin-top:1.5cm;
            margin-left:0.5cm;
            margin-right:1.0cm;
            margin-bottom:1.5cm;
            @bottom-center{ content: "Page " counter(page) " of " counter(pages); font:10px Arial;}

            }
            </style></head><body>
            some code
            </body>
            </html>

            Edited by: user11298802 on Mar 30, 2012 4:57 PM
            • 3. Re: title issue in jsp
              gimbal2
              I see that my comment about \
               tags was completely lost on you.
              
              In any case what you posted works just fine for me in Firefox. Perhaps you want to try with a proper doctype:
              <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
              <html xmlns="http://www.w3.org/1999/xhtml">
              <head>
              <title>Demo of attribute-set</title>
              <style>
              @page{
                   margin-top:1.5cm;
                   margin-left:0.5cm;
                   margin-right:1.0cm;
                   margin-bottom:1.5cm;
                   @bottom-center{ content: "Page " counter(page) " of " counter(pages); font:10px Arial;}
              }
              </style>

              </head>
              <body>
              some code
              </body>
              </html>