How to set an attribute of a HTML tag with a value in the Servlet

I have a HTML page and a Servlet.
The HTML page sends a request to the Servlet.
The Servlet has to read the contents of the HTML page. When the Servlet encounters the body tag it should set the bgcolor attribute of the body tag with a string(For eg.a string called color with a value blue) in the servlet.
After doing this the Servlet has to update the original HTML page with the changes (in the body tag).
I need a help on this.

Hi sangee,
you could get what you want to do by using a Java Server Page instead of both a HTML page and a Servlet.
I should code something like this:
<%Strung color="yourColor"%>
<html><head><title></title></head>
<body bgcolor="<%=color%>
</body>
</html>

Similar Messages

  • How to Set Up TextEdit as an HTML or Plain Text Editor?

    How to Set Up TextEdit as an HTML or Plain Text Editor?

    Well,
    There are 5 choices to choose from on the page. In the description of the choices at the bottom of the page there are 7, and the two additional choices talk about having to first have registered the site with SSO. So...I'm interpreting that as meaning that other 2 possible choices would be displayed if the site is registered with SSO. That, plus the fact that the page which describes how to add the site to SSO seems to think that the SSO choices are displayed in the wizard.
    So, no, there's no "exact launguage" that says what the reason is for the choices not being displayed. Can you point me to some exact language that tells me how to get those choices displayed?

  • How to set two attributes as  a primary key in database ?

    how to set two attributes as a primary key?
    Take COffeesbreak as an example ,
    let's suppose that there are cof_name ,sup_id,price and so on;
    the same cof_name may be suplied by more sup_ids,
    and one sup_id may suply more cof_names.
    so the Primary key should be set the cof_name and sup_id ,
    how to set ?
    (of course that i konw if I set a cof_id,the problem will be easy work out
    but now there are those like above)
    I set that as following:
    create table coffees (cof_name VARCHAR(32) PRIMARY KEY,sup_id INTEGER, PRIMARY KEY,PRICE INTEGER )
    THE database print error :cant add more primary keys!
    thanks in advance

    You can only use the PRIMARY KEY declaration on a column if it is the only Primary Key column.
    Use the PRIMARY KEY constraint statement instead.
    create table coffees (
      cof_name VARCHAR(32),
      sup_id INTEGER,  
      PRICE INTEGER,
      PRIMARY KEY ( cof_name ,sup_id )
    )Dave

  • How do I set BI Publisher to read html tags from the database?

    How do I set BI Publisher (Release 10.1.3.4) to read html tags from the database? For example if the text is quoted with a bold tag I want my output to display the text in bold. Is there a setting or something I can set?

    I took a look at Tim Dexter's blog as suggested and the sample worked, but for the elements in the xml file not for the value coming from the database, however this is good to know as well!
    I have data in the data base column which looks like this:
    'MS Applied <B(bold tag)> Mathematics</B(bold tag)>University of Southern California'
    I want the data to be rendered like this:
    'MS Applied <B>Mathematics</B> University of Southern California'.
    In Report Builder on the property sheet I would set Contains HTML Tags property to Yes and the report would render correctly.
    In BI Publisher 10.1.3.4 I can not seem set it to read this I have change the configure properties of the report to Character set to HTML and Make HTML output accessible to True. I just can't figure out what I'm missing.
    Thank you for any assistance you can offer.

  • How to set raw format for canon powershot a1100 is ? ,,according to the specs online it can.

    how to set raw format  for canon powershot  a1100 is ? ,,according to the specs online it can.

    It requires the Canon Hacker's Developement Kit (CHDK). It runs off of your SD card and does not harm your camera. Download a program called Stick-
    http://zenoshrdlu.com/stick/stick.html
    Follow the directions and you will be able to shoot in RAW along with some other deatures not available on your camera previously.

  • How to set background ChoiceBox item color to ChoiceBox with css?

    How to set background ChoiceBox item color to ChoiceBox with css?
    I need to change items list backgound color.
    I tried with following code, but it doesnt helps:
    .choice-box .context-menu {
      -fx-backgound-color: red;
    .choice-box .menu-item{
      -fx-background-color: red;

    In Java 8, either of your selectors should work.
    In Java 7 (JavaFX 2.2), you need the following workaround:
    #choice-box-menu-item {
         -fx-background-color: red ;

  • How to save HTML file with images present in the server to local machine

    Hi all
    In my application i have a option for the user to save HTML files with images present in the server. The HTML file is getting saved but the images are not being saved.
    The code i am using is below :-
    l
                        File fname = new File(filePath);
                        if(!fname.exists())                return;
                        FileInputStream istr = null;
                        OutputStream ostr = null;
                        response.setContentType("application/"+format);
                        response.setHeader("Content-Disposition", "attachment; filename=\"" + fname.getName() + "\";");
                        try { 
                             istr = new FileInputStream(fname);
                             ostr = response.getOutputStream();
                             int curByte=-1;
                             while( (curByte=istr.read()) !=-1)
                                  ostr.write(curByte);
                             ostr.flush();
    Can anyone suggest what i need to do
    regards

    The client should probably parse the html that comes down, and look for <img> links, and request those of the server as well.

  • How do i log in on a macbook air with out wifi for the first time

    How do i log in on a macbook air with out wifi for the first time

    More details needed.
    Otherwise just startup the computer and enter your password.
    New Mac?
    A new Mac comes with 90 days of free tech support from AppleCare.
    AppleCare: 1-800-275-2273
    Call AppleCare.
    Best.

  • TS1702 How can I rotate a video that I made with my iPod to the correct orientation?

    How can I rotate a video that I took with my iPod to the correct orientation?  My video is sideways and I can't find a way to make it show correctly.

    See if any of the previous discussions listed on the right side of this page under the heading More Like This help.
    Also you can Google for computer apps that will change the origination of videos.

  • [svn:bz-trunk] 13716: since include-read-only is a server global setting, we can't have two channels with different value.

    Revision: 13716
    Revision: 13716
    Author:   [email protected]
    Date:     2010-01-22 09:26:12 -0800 (Fri, 22 Jan 2010)
    Log Message:
    since include-read-only is a server global setting, we can't have two channels with different value.  remove the test for the include-read-only false.  update the service-config.xml as well.
    Modified Paths:
        blazeds/trunk/qa/apps/qa-regress/WEB-INF/flex/services-config.mods.xml
        blazeds/trunk/qa/apps/qa-regress/testsuites/mxunit/tests/remotingService/dataTypes/ReadOn lyTest.mxml

    You can give this a try on your Ultimate machine.  While these are said to be for Vista, I used it on my Win 7 machine just fine and it fixed the problems I was having.  Hope it works for you.
    The problem is that Vista, by default, will only use NTLMv2 for authentication, which is not supported by Mac OS X's Windows Sharing service.
    The other problem is the Minimum Session Security for NTVLM SSP based Clients.
    To get around this:
    1.     In Vista, open the Control Panel
    2.     Switch to "Classic" view
    3.     Double-click Administration Tools
    4.     Double-click Local Security Policy
    5.     Or Secpol.msc
    6.     Expand "Local Policies" and select "Security Options"
    7.     Alternate : Type secpol.msc to get editor up then
    8.     Locate "Network Security: LAN Manager Authentication Level" in the list and double-click it.
    9.     Change the setting from "Send NTMLv2 response only" to "Send LM & NTLM - use NTLMv2 session if negotiated"
    10.     Network Security: Minimum session security for NTLM SSP Based (including secure RPC) Clients
    11.     Change the setting from "require 128 bit" to unchecked (No Minimum)
    12.     Click OK
    the real difference between vista and windows 7 procedure is 10 and 11

  • How to set session attributes in a bean?

    How do I set a session attribute in a server-side bean?
    I'm not sure if I asked the question the right way. What I meant is, while it's easy to set session attributes in a JSP page (session.setAttribute("sessionname", "sessionvalue")), I'd want to set such an attribute within a server-side bean defined in this web application. But what is the syntax for doing it?

    Here a simple bean that stores something in the session and retrieves something from it.
    import javax.servlet.http.HttpSession;
    public class TestBean {
      private String value;
      public void doSomething(HttpSession session, int a, int b) {
        if (a+b > 0) {
          session.setAttribute("ab",Boolean.TRUE);
        } else {
          session.setAttribute("ab",Boolean.FALSE);
      public void init(HttpSession session) {
        if (session != null) {
          Boolean b = (Boolean)session.getAttribute("ab");
          if (b == Boolean.TRUE) {
            value = "a + b is greater than zero";
          } else {
            value = "a + b is not greater than zero";
        } else {
          value = "no session";
      public String getValue() {
        return value;
    }In your JSP, use something along the lines of :
    <%
      TestBean bean = new TestBean();
      bean.init(session);
      bean.doSomething(session,1,2);
    %>If your bean only lives during one request, you can pass the session to the constructor, which stores it in a private variable. This saves passing the session each time.
    Hope this helps,
    --Arnout                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to set a attribute value of a sub node binded to a table.. pls respond.

    Hi friends,
    I have context defined like this.
         Head_node ( table 1)
              Item_node ( table 2, sub node ).  ( now this im saving in global internal table).
    so now when i hit save button, im passing my internal table (it has col1- sales order no, col2 item details(table type, which can have more than one record) to a FM, to create sales order.
    My sales order is getting saved.
    But the function module will return some new values (like sales order number, item number etc).
    Now i want these values to be updated in my context.
    Meaning whenever after that i do get_attribute, i should get these new (sales order no, item no ) also.
    I dont know how to set the context values of sub nodes , so im missing these values.
    kindly respond back to me..
    thanks in advance,
    Niraja

    Its very simple.
    Follow these steps. e.g you want to get the new sales order number. Define a attribute in ur node (or set of attributes in ur case as per reqruirement) say new_so_number.
    Check your FM, if its returning new_so_number then it's fine, otherwise you have to change the FM to return the new_so_number or you have to get from db table somehow, which best suites your req.
    So once you have new_so_number after calling the FM, say in lv_new_so_number field. Then write this code to set the attribute (change the variables as per your context attributes)
    DATA lo_nd_head TYPE REF TO if_wd_context_node.
      DATA lo_el_head TYPE REF TO if_wd_context_element.
      DATA ls_head TYPE wd_this->element_head.
      DATA lv_new_so_number LIKE ls_head-new_so_number.
    * navigate from <CONTEXT> to <HEAD> via lead selection
      lo_nd_head = wd_context->get_child_node( name = wd_this->wdctx_head ).
    * get element via lead selection
      lo_el_head = lo_nd_head->get_element(  ).
    lv_new_so_number = new_so_number. " (You got this as a exporting parameter of FM etc..)
    * get single attribute
      lo_el_head->set_attribute(
        EXPORTING
          name =  `NEW_SO_NUMBER`
          value = lv_new_so_number ).
    Hope it works.

  • How to set block attributes in oracle forms 6i

    Dear gents,
    I have two blocks on one canvas, How can I set different attributes (say different colors) for each record separately given a certain condition in a multi record block.?
    Looking forward hearing from you.
    Many thanks,
    Steve

    Hi,
    You can use SET_ITEM_INSTANCE property.
    Regards,
    Chris.

  • How to set an attribute while creating an XML?

    Hi All,
    I am required to create an XML in the following manner :
    here  <ITEMS ITEMCOUNT="2"> where ITEM is an element and itemcount=2 is the attribute which means their are 2 line items
    - <HEADER>
      <PR_NO>sap pr no</PR_NO>
      <REVISION_NO>0</REVISION_NO>
       </HEADER>
    - <ITEMS ITEMCOUNT="2">
    - <ITEM>
      <PR_LINE_NO>1</PR_LINE_NO>
      <ITEM_DESCRIPTION>Security Locks</ITEM_DESCRIPTION>
      </LOCATIONS>
      </ITEM>
    </items>
    Please suggest how to set the attribute ITEMCOUNT?
    Thanks,
    Lina

    I am also trying to do something similar to this.  I tried the suggestion given but it still only allows 1 parameter.  A snippet of my .icd file is below.
    Attribute (ROI Settings) {
    Value (Integer) {
    Min (0)
    Max (79)
    Increment (1)
    Display {
    Multiplier (8.000000)
    Offset (0.000000)
    Precision (0)
    Units (Pixel)
    Default (0, 0, 0, 0)
    Current (0, 0, 0, 0)
    Action (Serial) {
    Command (ROI %d, %d, %d, %d\r)
    Response ()
    Timeout (1000)
    Delay (100)
    Any answer or help is appreciated.
    Thanks,
    Bruce

  • How to set TOC Image for "Import HTML articles"?

    For "Import HTML articles", I set TOC Image (70 x 70 px, PNG) on Folio Builder.
    But at Adobe Content Viewer on iPad, TOC Image doesn't appear.
    I confirmed on Dashboard, TOC Image for "Import HTML articles" appears correctly.

    According to the Page 56, 57, 61 of digitalpubsuite_help.pdf (Last updated 10/4/2011) ,
    "Change article properties" shows how to change TOC preview.
    I changed the TOC previews of some Stacks and the viewer table contents on iPad shows the TOC previews I expected.
    But for the HTML Stack (Import HTML article), the viewer table contents on iPad shows the thumbnail of HTML content (not the TOC previews).
    I confirmed on TOC Preview of Folio Builder and Dashboard of DPS,
    TOC preview for "Import HTML articles" appears correctly.
    What am I wrong?

Maybe you are looking for

  • Feature Requests for BlackBerry​10 OS

    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ This thread has been closed and is continued in this new thread here:  Feature Requests beyond BlackBerry OS10.3.1 Please click on that link. ++++++++++++++++++++++++++++++++++++++++++++++++++

  • Tried to install itunes update software and now error message coming up

    I tried to install the itunes update today and now its not working.  error message 7 keeps coming up- I have tried to trouble shoot but still not working.  uninstalled itunes and reinstalled, still not working. HELP

  • Progs + Apps randomly close/crash - why?

    Hello! I have a reccurring problem with my eMac. Programs such as Photoshop CS2 and more recently Itunes & IPhoto close without warning. The vanishing app is then replaced with a 'this program has unexpectadly closed, submit error report?' window. I

  • How do I delete an estimate from the build and price tool?

    I have been using the Cisco Build & Price tool to budget for upcoming projects and it has been very useful.  I have noticed however that I am unable to delete old estimates from my list of estimates.  Is this possible or are they in my queue forever?

  • How to auto divide a one-line string into several rows in jsf?

    <h:outputText value="#{msgs.aim}"     styleClass="content_text_darkblue"></h:outputText> for example, the #{msgs.aim} will be a long string that one line cannot output. how can i make it auto-break according to the row length instead of show a horizo