Extract HTML Meta information in the servlet ?

Guys,
I am using the following meta information in my HTML .
<META HTTP-EQUIV="msisdn" CONTENT="99999999">
<META HTTP-EQUIV="name" CONTENT="XXXXXXXX">
However, I unable to extract the header information in my Servlet class using the
String msisdn = request.getHeader("msisdn") and
String name = request.getHeader("name");
Can anybody please guide me ???

No it is not a professional or meaningful(to you) reply. But I'd have to say its about what you deserved.
You have to have patience on a forum like this. The community is not here to respond to your questions immediately. If you want an immediate answer, then you have to pay for one elsewhere. Bumping the topic after only 1/2 an hour demonstrates a lack of respect on your part, whereas if you had waited someone would probably eventually have taken a look at it, and known enough to give you a response. I would bump it after a day or two if nobody had responded.
Its basic forum etiquette. Useful link on [how to ask questions the smart way|http://www.catb.org/~esr/faqs/smart-questions.html]
'nuff said.
Now with regards to your question, if I understand correctly the <meta> tags are the equivalent of response headers to the html. ie they are information sent to the browser to be used for rendering the page. Not bits of information to send with the next request.
So having <META> tags on your page won't result in anything you can read in your servlet.
Cookies are the normal way that you get the browser to send information to a server for you.
Cheers,
evnafets

Similar Messages

  • 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>

  • How to split the particle analysis report in order to extract one particular information(for eg. orientation)??)

    hi .. i need to extract the orientation and centroid information from the particle analysis report (image processing is done in NI Vision and then converted to labview vi) for further processing. However once processing is done in Vision ,after converting to labview vi the particle analysis report comes as 1D array of size 1 and thus am unable to extract one particular information from the report. Plz help!   

    duplicate

  • How to specify HTML meta tags?

    I'm trying to get a portal to always have the following an HTML meta tag in the head of the generated HTML:
    <meta name="ROBOTS" content="NOFOLLOW" />
    I haven't seen any documentation about doing this in particular, but looking at some of the XML schema (*.xsd) files in various weblogic-specific jars, it seems like maybe the following would work in the <netuix:head> tag of the .portal configuration file for the portal:
    <netuix:head>
    <netuix:meta name="ROBOTS" content="NOFOLLOW" />
    </netuix:head>
    However, this does not seem to work.
    Also, I've checked the skin.properties file to see if there are any comments about how to specify meta tags, but there aren't any.

    Turns out there are a number of ways to do this. A BEA consultant recommended modifying the "head.jsp" for the portal's skin.
    Alternatively, it dawned on me that all I had to do was put the meta tags in a jsp and use that jsp in the head area of the .portal file. For example:
    <netuix:head>
    <netuix:jspContent contentUri="/resources/jsp/customHead.jsp"/>
    </netuix:head>

  • JDBC provides wrong meta information (Oracle 8.1.7)

    Hi all
    When I get the meta information about the datatype 'date', the literal prefix and the literal suffix are delivered as 'null'.
    When I execute an insert statement such as: 'insert into TEST_TABLE (BIRTHDATE) values (31.01.2002)' I get the error: 'ORA-00917: missing comma'
    Now I change the statement to 'insert into TEST_TABLE (BIRTHDATE) values ('31.01.2002')' everything works fine.
    It seems that the meta information are not correct! Does anybody have a hint?
    Thanks
    Kind regards

    Just a guess...
    The Oracle comm processes (net8 or whatever it is called) allows for different protocols to communicate. Your server is set up for a different protocol than the old one was. Either the client or the server needs to adjust.
    You can test this by creating a TSN and using sqlplus to connect. Once it works open up the TSN file (*.ora?) and get the correct params from there.

  • How to extract HTML page from the internet

    i am new to java, i wish to know how to extract Html page from the internet and also how to identify the differences between the images and text information?

    You can create a java.net.URL that points to the file you want to "extract" and read the HTML code (or what ever that file contains) from there using the inputstream given by URL.openStream().
    The difference between images and text... well, images are embedded in html using the img-tag. example: <IMG src="http://forum.java.sun.com/images/reply.gif" alt="Reply">. Attributes width, height, alt are sometimes left out and there may or may not be quotes around the values and everything is case insensitive... you'll be having hard time trying to parse the input so I'd suggest using existing parsers.
    What are you trying to do anyway? You can load a URL directly to a JTextEditorPane with the setPage(URL page) method...

  • Using lightroom 5.7.1 not all the meta-information is copied when exporting pictures

    using lightroom 5.7.1 not all the meta-information is copied when exporting pictures: city and country are not copied, although this information appears if i open the original file in photoshop. if i export this file via lightroom, the information dissappears.
    does anyone know how to solve this problem?

    thank you!
    although i did not change anything updating from lightroom3 to lightroom5, this box was automatically checked in all presets. now i unchecked it and everything works fine.

  • Servlets store information on the server side?

    i am working on a tapestry web app.
    is there a way for servlets to store some information on the server side independently. like a http session is visible to only the user who is viewing it, somebody else cannot view somebody elses http session details. but is there a way to share some common information inbetween all user sessions/pages. i dont want to store any info within the db but somewhere within tomcat.
    i hope i am able to express my question properly.

    I am a little confused when you say:
    A user logs onto the server and a new web application is started for him then another user logs on from another place and a new web application is started for that user.
    If they are hitting the same servlet in the same context (directory under your root webapps folder) then there is one web application. Each user is just starting a new session in that one web application. Each user is not creating a new web application.
    That being said, and if it is true (all the users are using the same servlets) then you should use the ServletContext to store data you want to share between users. That is what it is designed for. In Servlets (and JSPs) you can talk about four different scopes where data gets stored in a particular application:
    1) The 'page' scope is relevant only to JSPs, and represents data that is visible only to the current JSP page for the current user. The object used is called PageContext.
    2) The 'request' scope stores data available to all servlets accessed by a single user through a single request (so if forwards, or includes are used to get from one servlet to another). The ServletRequest object is used to store this data.
    3) The 'session' scope stores data available to a single user across multiple requests. The HttpSession object stores this info.
    4) The 'application' scope stores data available to all users across all requests. The ServletContext object stores this info.
    All of the scopes have data stored/retrieved via setAttribute(key,value) and getAttribute(key) methods.
    "cant i maintain a list of users who are generating or viewing a web app from my server at any instance"
    Yes you can. I would use a SessionListener to listen for when new sessions are created. When they are get the information you need and add them to a list in the ServletContext where all users can see it. Then in the SessionListener listen for when a session is destroyed, and remove the user from the list.

  • How to specify the servlet in the ACTION field in FORM in jsp, html pages?

    I have problem when I return back to the page prova3.html from the servlet because in the address bar it give me this path:
    http://192.168.161.209:8988/Workspace3-Project1-context-root/servlet/servlet/Servlet1
    two times servlet/ why? and what I have to put in the action field?
    This is my form in page prova3.html:
    <form action="servlet/Servlet1" method="post" id="search" style="font: bold 80% Arial,sans-serif; color: #334d55;" >
    <input type="hidden" name="pagina" value="1"/>
         user<input name="username" type="text" size="10" style="font-size: 12px;"/> 
    password<input name="password" type="password" size="10" style="font-size: 12px;"/>
         <input name="login" type="submit" value="Login" style="font-size: 12px; font-family: Arial,sans-serif;"/>
    </form>
    The redirection form servlet to pages is:
    private void toProvaPage(HttpServletRequest request, HttpServletResponse response) throws
    ServletException, IOException {
    RequestDispatcher rd = getServletContext().getRequestDispatcher(
    "/prova.jsp");
    rd.forward(request, response);
    private void toIndexPage(HttpServletRequest request, HttpServletResponse response) throws
    ServletException, IOException {
    RequestDispatcher rd = getServletContext().getRequestDispatcher(
    "/prova3.html");
    rd.forward(request, response);
    Thanks, but I can solve this problem.

    This is my web.xml file where the mapping is specified, this is the thing that I can't understand.
    <web-app>
    <description>Empty web.xml file for Web Application</description>
    <display-name>public_html</display-name>
    <servlet>
    <servlet-name>Servlet1</servlet-name>
    <servlet-class>servlet.Servlet1</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>Servlet1</servlet-name>
    <url-pattern>/servlet1</url-pattern>
    </servlet-mapping>
    <session-config>
    <session-timeout>35</session-timeout>
    </session-config>
    <mime-mapping>
    <extension>html</extension>
    <mime-type>text/html</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>txt</extension>
    <mime-type>text/plain</mime-type>
    </mime-mapping>
    </web-app>
    Thanks

  • Where the servlet information stored?

    where the servlet information stored if I overriding the function getServletInfo? I am using Tomcat 4.1.12

    It is stored in the servlet instance as a String variable. getServletInfo by default returns an empty String. When you over ride the method all of the information is stored in the servlet just like any other variable data.

  • Does the Extract Single Tone Information.vi only find the fundamental harmonic?

    I capture a waveform that only has 1 frequency.  If I use the Extract Single Tone Information.vi to extract a single tone, is this single tone the fundamental harmonic?  And if I feed the residual portion of the waveform into the Extract Single Tone Information.vi, will the next tone be the second harmonic?  And so on?  Is it possible to compute the total harmonic distortion just by feeding the the waveform into the Extract Single Tone Information.vi over and over again (only feed the residual waveform into the vi continously)?
    Message Edited by solitude on 08-18-2005 09:28 AM

    Notice the title of the vi:  Extract SINGLE Tone.  It is expecting only one frequency.  This vi is not intended to handle a carrier frequency or audio with harmonics.  You say that you capture a waveform that has 1 frequency.  If this is so, then there should be no harmonics.  To measure harmonic frequencies, you must perform spectral analysis.  To measure total harmonic distortion, there exists a THD vi in the Waveform Analysis palette.
    - tbob
    Inventor of the WORM Global

  • Null values passed into the servlet

    Hi all,
    I keep getting null values for all the params that I pass into the servlet i.e. sqltype, producttype, process, instance etc....I have attempted to print some of them out on the screen but I keep getting the 'NullPointerException' error message...can anyone tell me what it is that I have down wrong in the below code?
    If I run the servlet with method calls that have hardcoded arguments in them it works but not when I pass in the params from the URL...I am absolutley puzzled!
    Help!
    package blotter;
    import java.io.IOException;
    import java.io.PrintWriter;
    import java.util.Date;
    import javax.servlet.ServletConfig;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import com.db.util.WriteToLogFile;
    import blotter.cache.*;
    Servlet to extract an object that has already been placed
    in the cache by GetBondPrices servlet from the cache.
    public class ExtractSecurityObject extends HttpServlet
         String sqlType = "";
         String productType = "";
         String instance = "";
         String process = "";
         String asOfDate = "";
         String currencyCode = "";
         String curveId = "";
         String results = "";
         private String debug;
    private PrintWriter out;
         private WriteToLogFile logFile;
         // called when servlet first initialised
         public void init(ServletConfig config) throws ServletException
              super.init(config);
         // method called for each get request
         public void doGet( HttpServletRequest request, HttpServletResponse response )
                   throws ServletException, IOException
              String toWrite = " ";
    // Get the object identifier from the parameters passed in
              sqlType = request.getParameter("sqltype");
    productType = request.getParameter("producttype").toUpperCase();
              instance = request.getParameter("instance");
              process = request.getParameter("process");
              asOfDate = request.getParameter("asofdate");
              curveId = request.getParameter("curveid");
              currencyCode = request.getParameter("ccy").toUpperCase();
              out.println(currencyCode);
              if ( request.getParameter("debug") !=null)
                   debug = request.getParameter("debug");
              else
                   debug ="";
              // set the mime type to html
    response.setContentType( "text/html" );
    out = response.getWriter();
    out.println("<HTML>");
              try
              // write some parameters to a log file
              toWrite = toWrite + "<li>" + getServletInfo() + " at " + new Date() + " " + sqlType + " " +
                        productType + " " + instance + " " + process + " " + asOfDate + " " + curveId + " " +
                        currencyCode;
         CachedObject o1 = (CachedObject)CacheManager.getCache("EB_" + currencyCode + productType + asOfDate);
    if(o1 == null){
              CacheSecurityObject cso = new CacheSecurityObject();
                   if((request.getParameter("sqltype") == null) && (request.getParameter("instance") != null)){
    results = (String)cso.putSecurityinCache(null, request.getParameter("producttype"), request.getParameter("instance"), request.getParameter("process"), request.getParameter("asOfDate"), request.getParameter("curveId"), request.getParameter("currencyCode"));
    //results = (String)cso.putSecurityinCache(null, "yc", "frafu", "official", "20011105", "baceod", "sek");
    out.println(results);
                   } else {
    //results = (String)cso.putSecurityinCache("bondtypes", "bond", null, "official", "20011105", "baceod", "eur");
    results = (String)cso.putSecurityinCache(request.getParameter("sqltype"), request.getParameter("producttype"), null, request.getParameter("process"), request.getParameter("asOfDate"), request.getParameter("curveId"), request.getParameter("currencyCode"));
    out.println(results);
              else{
                   out.println(((String)o1.object).toString());
    // general catch for all exceptions
              catch(Exception exception)
                   out.println( "Exception: The item that you requested was not found in the cache" + "<BR>" );
                   toWrite = toWrite + "Exception : " + exception.getMessage() + "\n" ;
              finally
    // write to logfile
              logFile = new WriteToLogFile();
              logFile.setSourceDirName("blotter");
              logFile.setQuery(request.getQueryString());
              logFile.setServletPath(request.getServletPath());
              if (toWrite!=null)
              logFile.writeLog(getServletInfo(),toWrite);
    out.println("</HTML>");
              out.close();
         // need the class name for log file
         public String getServletInfo()
         return this.getClass().getName();
    }

    That section of the code references a cache to extract an item that has been requested by the user. If the item is not in the cache i.e. if(o1 == null) then it will call a class that generates that object and places that object into the cache. The second time the user makes the same call then they will be handed a cached copy of that object which is aimed to make the whole servlet call faster.
    That section of the code works fine coz I have tested that separately. It is the reading in of the arguments that is causing the problem.

  • How to track meta information throughout a site

    I was wondering if there is an easy way to track meta information (keywords, descrption) and possibly page titles throughout a site and have it exported to something like an excel spreadsheet.  I'm trying to track meta and title information over time and see how changes affect google rankings.  It would be nice if I could extract the data quickly instead of going page by page.  Odd request, I know...
    Thanks in advance for any help.

    A good idea is to use something like Log4J to handle logging in your application. You do have to be careful if your application is clustered and there is serialization involved since your logger won't be serializable, causing clustering to fail (I swear it didn't happen to me)....
    private transient Logger log = null;
    protected final Logger getLogger() {
        if (this.log == null)
            this.log = LogFactory.getLogger(this.getClass());
        return this.log;
    }

  • I want to send a response from the servlet and then call another servlet.

    Hi,
    I want to send a response from the servlet and then call another servlet. can this happen. Here is my scenario.
    1. Capture all the information from a form including an Email address and submit it to a servlet.
    2. Now send a message to the browser that the request will be processed and mailed.
    3. Now execute the request and give a mail to the mentioned Email.
    Can this be done in any way even by calling another servlet from within a servlet or any other way.
    Can any one Please help me out.
    Thanks,
    Ramesh

    Maybe that will help you (This is registration sample):
    1.You have Registration.html;
    2.You have Registration servlet;
    3.You have CheckUser servlet;
    4.And last you have Dispatcher between all.
    See the code:
    Registration.html
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <HTML>
      <HEAD>
        <TITLE>Hello registration</TITLE>
      </HEAD>
      <BODY>
      <H1>Entry</H1>
    <FORM ACTION="helloservlet" METHOD="POST">
    <LEFT>
    User: <INPUT TYPE="TEXT" NAME="login" SIZE=10><BR>
    Password: <INPUT TYPE="PASSWORD" NAME="password" SIZE=10><BR>
    <P>
    <TABLE CELLSPACING=1>
    <TR>
    <TH><SMALL>
    <INPUT TYPE="SUBMIT" NAME="logon" VALUE="Entry">
    </SMALL>
    <TH><SMALL>
    <INPUT TYPE="SUBMIT" NAME="registration" VALUE="Registration">
    </SMALL>
    </TABLE>
    </LEFT>
    </FORM>
    <BR>
      </BODY>
    </HTML>
    Dispatcher.java
    package mybeans;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.ServletException;
    import java.io.IOException;
    import javax.servlet.RequestDispatcher;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class Dispatcher extends HttpServlet {
        protected void forward(String address, HttpServletRequest request,
                               HttpServletResponse response)
                               throws ServletException, IOException {
                                   RequestDispatcher dispatcher = getServletContext().
                                   getRequestDispatcher(address);
                                   dispatcher.forward(request, response);
    Registration.java
    package mybeans;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class Registration extends Dispatcher {
        public String getServletInfo() {
            return "Registration servlet";
        public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
            ServletContext ctx = getServletContext();
            if(request.getParameter("logon") != null) {          
                this.forward("/CheckUser", request, response);
            else if (request.getParameter("registration") != null)  {         
                this.forward("/registration.html", request, response);
    CheckUser.java
    package mybeans;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    public class CheckUser extends Dispatcher {
        Connection conn;
        Statement stat;
        ResultSet rs;
          String cur_UserName;
        public static String cur_UserSurname;;
        String cur_UserOtchestvo;
        public String getServletInfo() {
            return "Registration servlet";
        public void service(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
            try{
                ServletContext ctx = getServletContext();
                Class.forName("oracle.jdbc.driver.OracleDriver");
                conn = DriverManager.getConnection("jdbc:oracle:oci:@eugenz","SYSTEM", "manager");
                stat = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
               String queryDB = "SELECT ID, Login, Password FROM TLogon WHERE Login = ? AND Password = ?";
                PreparedStatement ps = conn.prepareStatement(queryDB); 
               User user = new User();
            user.setLogin(request.getParameter("login"));
            String cur_Login = user.getLogin();
            ps.setString(1, cur_Login);
            user.setPassword(request.getParameter("password"));
            String cur_Password = user.getPassword();
            ps.setString(2, cur_Password);
         Password = admin");
            rs = ps.executeQuery();
                 String sn = "Zatoka";
            String n = "Eugen";
            String queryPeople = "SELECT ID, Surname FROM People WHERE ID = ?";
           PreparedStatement psPeople = conn.prepareStatement(queryPeople);
                      if(rs.next()) {
                int logonID = rs.getInt("ID");
                psPeople.setInt(1, logonID);
                rs = psPeople.executeQuery();
                rs.next();
                       user.setSurname(rs.getString("Surname"));
              FROM TLogon, People WHERE TLogon.ID = People.ID";
                       ctx.setAttribute("user", user);
                this.forward("/successLogin.jsp", request, response);
            this.forward("/registration.html", request, response);
            catch(Exception exception) {
    }CheckUser.java maybe incorrect, but it's not serious, because see the principe (conception).
    Main is Dispatcher.java. This class is dispatcher between all servlets.

  • HTML file reference to a Servlet file...Very Urgent

    Hi
    i am new to JSP and servlet..........
    i already build a servlet file.
    I am submitting the html form to this servlet file.
    but i encounter problem........
    <form method="POST" action="../servlet/SearchSong">
    SearchSong(my class name)
    but i kept getting error "the requested resource is not available"
    what wrongs ...please help

    Too little information ...
    Case 1. Define your servlet mappings in your web.xml file and check if you are giving the correct URL for the servlet in your form action
    Case 2. Each server has a default folder for servlets. I guess you are trying to do something like this. In this case you have to look at your server documentation on the URL to be used to invoke servlets.

Maybe you are looking for