JSTL URL

I have the following jstl c:url tag. So I want to forward to a page with the value I get in the forEach tag. But it dont seem to work as it dont forward it, if I hardcode a value, it works. am i doing anything wrong?
<c:forEach var="row" items="${rsAdmin.rows}">
          <c:set var="urlTemp" value="${row.url}" scope="session"/>
</c:forEach>
<c:url value="${urlTemp}" var="forwardURL"></c:url>
<jsp:forward page="${forwardURL}"/>

Are you using JSTL 1.1 rather than JSTL 1.0?
Are you using a JSP 2.0 container, like Tomcat 5?
Do you have the web application set to use the servlet 2.4 specs rather than the 2.3 specs?
You can search these forums to figure out how to check each of these answers. If they are not all answered "Yes" then you will not be able to use the EL expressions outside of JSTL (<jsp:forward> is not JSTL, it is a JSP syntax tag).
And just to check out what the value of urlTemp actually is, you could use:
<b>URLTemp value: </b>${urlTemp}
Which should work if all of the answers to the questions above were "Yes" and you actually have a value in the variable.

Similar Messages

  • Url link problem

    for my project, i create a table to that store some field and a url. then i rs,getString(url)(example www.yahoo.com). what is shown on my address is (http://localhost:8080/www.yahoo.com). how do i actually do so that i can get to www.yahoo.com.

    Hey,
    my jstl urls will not render properly. I am using:
    <c:forEach var="row" items="${rs.rows }">
    <h4>${row.startdate }</h4>
    <c:url var="url" value="announceDetail.jsp" >
    <c:param name="announceidid" value="${row.announceid}" />
    </c:url>
    <p>${row.content}</p></li>
    </c:forEach>
    The url turns out to be
    http://testchem.chem.columbia.edu/ugrad/$urlWhat am I doing wrong?
    M

  • JSF / Switch between HTTP and HTTPS

    Hello!
    I want to switch between HTTP and HTTPS using JSF.
    Under Apache Struts framework I can use struts extension "sslext.jar" to configure switching between http and https in one web application.
    e.g. Login-jsp should be secured, all other jsp's should run unsecured.
    Any ideas?
    regards
    Harald.

    Thanks,
    I made the necessary enhancement for the second phase, password confirmation required when return to SSL zone after leaving it after a succesful login.
    I did the following:
    1) create a class in the application scope and/or singleton class with the servlet paths that require SSL
    2) create a plugin that reads ActionConfigs from the ModuleConfig
    3) create a filter that sets a request scope flag that says that password must re-entered.
    Code Extracts:
    1) MainshopContainer application level parameter singleton class:
    private static HashMap sslZoneMap = new HashMap(50); // key = servlet path of request, example /login.do
    public boolean isInSSLZone(String servletPath)
    return this.sslZoneMap.containsKey(servletPath);
    public void addToSSLZone(String servletPath)
    this.sslZoneMap.put(servletPath,null);
    public int getNumberOfActionsInSSLZone()
    return this.sslZoneMap.size();
    2) Struts plugin
    add a call to loadSSLZoneMap in plugin init method:
    loadSSLZoneMap(config, mainshopContainer);
    private void loadSSLZoneMap(ModuleConfig config, MainshopContainer mainshopContainer)
    throws ServletException
    try {       
    ActionConfig[] actionConfigs = config.findActionConfigs();
    for (int i = 0; i < actionConfigs.length; i++)
    if (actionConfigs.getParameter().indexOf("/jsp/account/") < 0) // /account/* = URL path for SSL zone
    // not found = not ssl zone
    System.out.println("loadSSLZoneMap, following actionConfigs excluded from SSL Zone: "+actionConfigs[i].getPath());
    else
    // found = ssl zone
    String servletPath = actionConfigs[i].getPath()+".do";
    mainshopContainer.addToSSLZone(servletPath);
    System.out.println("loadSSLZoneMap, following servletPath added to SSL Zone: "+servletPath);
    System.out.println("loadSSLZoneMap, number of actions in SSL Zone: "+mainshopContainer.getNumberOfActionsInSSLZone());
    catch (Exception ex)
    ex.printStackTrace();
    throw new ServletException("Exception caught in loadSSLZoneMap: "+ex.toString()+" Initialization aborted.",ex);
    3)
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
    throws IOException, ServletException {
    HttpServletRequest req = (HttpServletRequest) request;
    HttpServletResponse res = (HttpServletResponse) response;
    String servletPath = req.getServletPath();
    boolean secure= this.mainshopContainer.isInSSLZone(servletPath);
    The wole picture:
    The filter adds a RequestDTO object that includes all request parameters, one of them is the secure flag.
    I have a session scope class UserContainer that includes all the session parameters, one of them is the lastRequestDTO.(last made request)
    At the end of all my jsp's I set the lastRequestDTO variable.
    In that method I set the passwordConfirmationRequired flag if needed:
    public void setLastRequestDTO(RequestDTO _lastRequestDTO)
    if (this.lastRequestDTO != null && this.lastRequestDTO.isSecure() != _lastRequestDTO.isSecure())
    this.setPasswordConfirmationRequired(true);
    this.lastRequestDTO = _lastRequestDTO;
    I read the passwordConfirmationRequired in all my jsp's in the SSL zone that allow editing or deleting and if that flag is true, a valid password must be re-entered in order to make the updates.
    When the password is OK I reset the passwordConfirmationRequired to false.
    I need some help for the first phase, that is SSL setup for all actions related to jsp's with url path /account/*
    I tought I could define it in the web.xml:
    <security-constraint>
    <web-resource-collection>
    <web-resource-name>All Account Related Pages</web-resource-name>
    <url-pattern>/account/*</url-pattern>
    </web-resource-collection>
    <user-data-constraint>
    <transport-guarantee>CONFIDENTIAL</transport-guarantee>
    </user-data-constraint>
    </security-constraint>
    but that doesn't work and finnaly understood why:
    Example: /WEB-INF/jsp/account/login.jsp corresponds to /login.do
    The url pattern /account/* at the container level is never encountered.
    Is it allowed to declare the following action path: /account/login instead of /login?
    If yes I could add following prefix /account to all my action paths and forward paths and this could resolve my problem.
    What's your opinion?
    If no, would your library resolve this?
    Will all the Struts/JSP/JSTL url generating tags pick-up the required protocol (http/https) according to your configuration file?
    Regards
    Fred

  • Does JSF like XML?

    It seems that actually using XML as a source file for my JavaServer Faces JSP files is severely limiting my ability to create even simple functionality.
    Let's say that I want to put in a simple stylesheet link, but I want it to be relative to the context. (Otherwise, I couldn't include the JSP file in other JSP files in different directories, because the link is relative to the enclosing JSP's base URI.)
    In old, outdated, non-XML source code, that's easy, if not pretty:
    <html>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="jsf" %>
    <jsf:view>
         <head>
              <link rel="stylesheet" type="text/css" href="<%= request.getContextPath()%>/style/sheet.css"/>
    But I want to use XML for my source JSP file. So I start with this:
    <?xml version="1.0"?>
    <jsp:root version="2.0"
         xmlns:jsp="http://java.sun.com/JSP/Page"
         xmlns:jsf="http://java.sun.com/jsf/core"
    <jsf:view>
    <jsp:output omit-xml-declaration="false" doctype-root-element="html" doctype-public="-//W3C//DTD XHTML 1.1//EN" doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"/>
         <html xmlns="http://www.w3.org/1999/xhtml">
         <head>
    Now what? I can't use <%=...> in the <link> href attribute value, because that attribute (according to Tomcat 5.5.2) can't contain the "<" character.
    Using ${pageContext.request.contextPath}/style/sheet.css results in the entire literal string being sent to the browser---no replacement. The same goes for #{facesContext.externalContext.request.contextPath}.
    Are those who use XML-compliant source files limited in JSF functionality?
    Starting to be disillusioned,
    Garret

    This is easily solved using JSTL:
    <c:url value="/styles.css" var="styles"/>
    <link rel="stylesheet" type="text/css"
    href="${styles}" />I beg to differ! I have:
    <?xml version="1.0"?>
    <jsp:root version="2.0"
         xmlns:jstl="http://java.sun.com/jstl/core"
         xmlns:jsp="http://java.sun.com/JSP/Page"
         xmlns:jsf="http://java.sun.com/jsf/core"
         xmlns:html="http://java.sun.com/jsf/html">
    <jsf:view>
         <jsp:output omit-xml-declaration="false" doctype-root-element="html" doctype-public="-//W3C//DTD XHTML 1.1//EN" doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"/>
         <html xmlns="http://www.w3.org/1999/xhtml">
         <head>
              <title>Test</title>
              <jstl:url value="/styles.css" var="styles"/>
              <link rel="stylesheet" type="text/css" href="${styles}" />
         </head>
         <body>
         </body>
         </html>
    </jsf:view>
    </jsp:root>This sends the following stylesheet link back to my browser:
    <link href="${styles}" type="text/css" rel="stylesheet"/>(Try it yourself.)
    I'm using JSF 1.1_01 on Tomcat 5.5.2. I cannot get a ${} expression to be substituted.
    Garret

  • Previous Page's URL in JSP/JSTL

    Dear Sirs,
    Could you please advice me how I could get the previous page's url( ie, the page the the user was visting before coming to the current page) in JSP/JSTL..
    Thank you in advance

    You mean the referrer? You can just get it from the HTTP header.
    String referrer = httpServletRequest.getHeader("referer"); // Yes, with the legendaric misspelling.

  • URL rewriting using JSTL

              We are trying to use URL rewriting using JSTL. We have some problems facing URL
              rewriting. The issues we have are
              (1) We use absolute URLs
              (2)Some times we have situations based on certain input field validations
              we use
              javascript to perform URL rewriting based on the input by the user.
              Have anyone done URL rewriting using JSTL (absolute URL versus relative URLS)
              Regds
              Guna
              

    Hi
    Kalpesh Chhatrala,
    If this issue still not resolved, please consider to post in WCF forum.
    Here is the link
    https://social.msdn.microsoft.com/Forums/en-US/home?forum=wcf
    Now i will move your thread to Off-topic forum. If you have any other issues about C#, please feel free to post in this forum. Thanks for your understanding.
    Thanks
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Jstl passing sql c:forEach in url

    I am using jstl to pull info from db. How can I put a value, like row.columnName, in an url?
    Whe I did it before I got alot of garbage in the url.

    I don't recommend adding it as a query string parameter, but here is the URL:
    http://localhost:8080/psc/hlbhrdev/EMPLOYEE/HRMS/c/ADMINISTER_WORKFORCE_(USF).EE_HR_PROC.USF?userid=VP1&pwd=VP1
    The recommended approach would be to use a POST instead of a GET, which would put the username and password into the body of the request instead of the URL of the request.

  • JSTL to access url string

    Hi All,
    Is it possible to access the url string using jstl ? What about the equivalent to the jsp code 'request.getRequestURL()' in jstl ?
    Any pointers ? Much Appreciated...

    You can get at the request object through the pageContext
    ${pageContext.request.requestURL}
    Cheers,
    evnafets

  • Dynamic url to XML file url in jstl

    Hi!
    What i need to do:
    1. I get some parameters when entering a jsp page
    2. I use these parameters to get an xml file from a server
    3. I get a url to a picture from the xml file and load it
    The problem is when i need to create the url to that xml file.
    1. I read the parameters
    String x = request.getParameter("X");
    String y= request.getParameter("Y");
    2. forming the url to xml file
    this doesnt work:
    <c:import url="http://www.website.com/something/something.jsp?xcoord=x&ycoord=y" var="xml">
    <x:parse...
    this works, but it is static...
    <c:import url="http://www.website.com/something/something.jsp?xcoord=5&ycoord=6" var="xml">
    <x:parse...
    It is propable that i read the parameters in a wrong way... what is the right way? Heh, i hope u understood what i tried to tell. :)

    This is maybe because you are using a String and an Integer.
    Try this:
    int x = Integer.parseInt(request.getParameter("X"));
    int y = Integer.parseInt(request.getParameter("Y"));Happy Coding! :-)
    bye ki

  • How to enable jsessionid in url with Struts and JSTL?

    Hi
    I'm developing a struts application that will work with WAP devices. I have to guarantee that the jsessionid parameter is generated in every URL because cookies don't work with WAP 1.0 devices. Specifically in:
    1.- Struts forwards that uses redirect.
    2.- Using the <c:url /> tag
    I sent a message to the struts list and they responded that this is a container feature that has to be enabled. Where can I configure OC4J to use the jsessionid parameter instead of the cookie?

    Hi,
    This is not the right forum for ur post. Post ur issue at forums.oracle.com/forums/forum.jspa?forumID=82
    Regards,
    Gyan

  • Help needed to run JSTL 1.1 in Tomcat 6.0.16

    Hi All,Help needed to run JSTL 1.1 in Tomcat 6.0.16. I am trying to run the example given in http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html The example tries to connect to MySQL database from JSP using JSTL and JNDI Datasource.I am running the example using Eclipse 3.4.2 using Sysdeo plugin to start and stop Tomcat server from Eclipse IDE.
    My web.xml file has <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
    </web-app>
    and test.jsp has proper taglib directives
    <%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    I have placed the jstl.jar and standard.jarof the jakarta-taglibs-standard-1.1.2.zip under E:\Deepa\workspace\DBTest\WebContent\WEB-INF\lib directory also placedcontext.xml file under E:\Deepa\workspace\DBTest\WebContent\META-INF and the content of context.xml is as below
    <Context path="/DBTest" docBase="DBTest"
    debug="5" reloadable="true" crossContext="true">
    <Resource name="jdbc/TestDB" auth="Container" type="javax.sql.DataSource"
    maxActive="100" maxIdle="30" maxWait="10000"
    username="deepa" password="mysql" driverClassName="com.mysql.jdbc.Driver"
    url="jdbc:mysql://localhost:3306/javatest?autoReconnect=true"/>
    </Context>
    Now while running the example, Eclipse creates one DBTest.xml file under C:\Program Files\Apache Software Foundation\Tomcat 6.0\conf\Catalina\localhost
    which has the following line:
    <Context path="/DBTest" reloadable="true" docBase="E:\Deepa\workspace\DBTest" workDir="E:\Deepa\workspace\DBTest\work" />
    I am getting the following error when running http://localhost/DBTest/WebContent/test.jsp
    in Browser:
    <HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsp/jstl/sql cannot be resolved in either web.xml or the jar files deployed with this application
    org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:51)
    org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
    org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:116)
    org.apache.jasper.compiler.TagLibraryInfoImpl.generateTLDLocation(TagLibraryInfoImpl.java:315)
    org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:148)
    org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:431)
    org.apache.jasper.compiler.Parser.parseDirective(Parser.java:494)
    org.apache.jasper.compiler.Parser.parseElements(Parser.java:1444)
    org.apache.jasper.compiler.Parser.parse(Parser.java:138)
    org.apache.jasper.compiler.ParserController.doParse(ParserController.java:216)
    org.apache.jasper.compiler.ParserController.parse(ParserController.java:103)
    org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:154)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:315)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:282)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:586)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    In the Tomcat Server console, I am getting the following error:
    INFO: Server startup in 7295 ms
    May 20, 2009 6:36:48 AM org.apache.jasper.compiler.TldLocationsCache processWebDotXml
    WARNING: Internal Error: File /WEB-INF/web.xml not found
    May 20, 2009 6:36:48 AM org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Servlet.service() for servlet jsp threw exception
    org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsp/jstl/sql cannot be resolved in either web.xml or the jar files deployed with this application
    what is the problem with my code?
    When running the same example, by creating a local server in Eclipse(creating new Server connection pointing to same Tomcat 6.0 installation) it runs fine without any error.

    Hi evnafets,
    Wow, very helpful information, great insight into working of Eclipse. Thanks a lot.
    I have one more question. I have a context.xml file under {color:#0000ff}E:\Deepa\workspace\DBTest\WebContent\META-INF{color} folder and that has the Resource element to connect to MySQL database:
    {code{color:#000000}}{color}<Context path="/DBTest" docBase="DBTest" debug="5" reloadable="true" crossContext="true">
    <Resource name="jdbc/TestDB" auth="Container" type="javax.sql.DataSource" maxActive="100" maxIdle="30" maxWait="10000" username="deepa" password="mysql" driverClassName="com.mysql.jdbc.Driver"
    {color:#0000ff}url="jdbc:mysql://localhost:3306/javatest?autoReconnect=true"/>{color}
    {color:#0000ff}</Context>{color}As usual when running application in local Tomcat server of Eclipse, this data source works fine. But when I run the application on Tomcat, by starting Sysdeo plugin from Eclipse, the DBTest.xml file created in C:\Tomcat 6.0\conf\Catalina\localhost has the context entry as<Context path="/DBTest" reloadable="true" docBase="E:\Deepa\workspace\DBTest\WebContent" workDir="E:\Deepa\workspace\DBTest\work">
    </Context>The<Resource> element I have specified in the context.xml of \WebContent\META-INF folder is not taken into account by Tomcat and it gives the following error:May 21, 2009 5:20:04 AM org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Servlet.service() for servlet jsp threw exception
    javax.servlet.jsp.JspException: Unable to get connection, DataSource invalid: "org.apache.tomcat.dbcp.dbcp.SQLNestedException_: Cannot create JDBC driver of class '' for connect URL 'null'"
    _at org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.getConnection(_QueryTagSupport.java:276_)
    at org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.doStartTag(_QueryTagSupport.java:159_)
    at org.apache.jsp.test_jsp._jspx_meth_sql_005fquery_005f0(_test_jsp.java:113_)
    at org.apache.jsp.test_jsp._jspService(_test_jsp.java:66_)
    at org.apache.jasper.runtime.HttpJspBase.service(_HttpJspBase.java:70_)
    at javax.servlet.http.HttpServlet.service(_HttpServlet.java:717_)
    at org.apache.jasper.servlet.JspServletWrapper.service(_JspServletWrapper.java:374_)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(_JspServlet.java:342_)
    at org.apache.jasper.servlet.JspServlet.service(_JspServlet.java:267_)
    at javax.servlet.http.HttpServlet.service(_HttpServlet.java:717_)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(_ApplicationFilterChain.java:290_)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(_ApplicationFilterChain.java:206_)
    at org.apache.catalina.core.StandardWrapperValve.invoke(_StandardWrapperValve.java:233_)
    at org.apache.catalina.core.StandardContextValve.invoke(_StandardContextValve.java:191_)
    at org.apache.catalina.core.StandardHostValve.invoke(_StandardHostValve.java:128_)
    at org.apache.catalina.valves.ErrorReportValve.invoke(_ErrorReportValve.java:102_)
    at org.apache.catalina.core.StandardEngineValve.invoke(_StandardEngineValve.java:109_)
    at org.apache.catalina.connector.CoyoteAdapter.service(_CoyoteAdapter.java:286_)
    at org.apache.coyote.http11.Http11Processor.process(_Http11Processor.java:845_)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(_Http11Protocol.java:583_)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(_JIoEndpoint.java:447_)
    at java.lang.Thread.run(_Thread.java:619_)
    {code}
    So to overcome this error I had to place the <Resource> element in DBTest.xml under C:\Tomcat 6.0\conf\Catalina\localhost {color:#000000}and then it works fine. {color}{color:#ff0000}*Why is the context.xml file in META-INF not considered by Tomcat server using Sysdeo Plugin?*
    *Thanks,*
    *Deepa*{color}
    {color}
    Edited by: Deepa76 on May 26, 2009 9:32 PM

  • JSTL c:out and PageContext: need help!!!!!!!!!!!!!

    hi, i'm finding problems using core tag libraries, and i can't understand how to solve but expecially WHY i'm getting all those compilation errors....
    first, i post my jsp's scriptlets section for evaluating errors, but please, firstly go to the end of scriptlet's section to understand what i'm asking.
    ################# JSP'S SCRIPTLETS SECTION ##############
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@page session="true"%>
    <%--
    The taglib directive below imports the JSTL library. If you uncomment it,
    you must also add the JSTL library to the project. The Add Library... action
    on Libraries node in Projects view can be used to add the JSTL 1.1 library.
    --%>
    <%--
    <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    --%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd">
    <%@page import="services.sessionservice.*"%>
    <%@page import="util.*"%>
    <%@ taglib prefix="x" uri="http://java.sun.com/jstl/xml" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
    <jsp:useBean id="loginManagement" class="bflows.LoginManagement" scope="session"/>
    <jsp:setProperty name="loginManagement" property="nickName" param="nickName"/>
    <jsp:setProperty name="loginManagement" property="password" param="password"/>
    <jsp:setProperty name="loginManagement" property="loggedOn" value="false"/>
    <%
        Cookie[] cookies = request.getCookies();
        String message = null;
        // SETTO UN ATTRIBUTO CON SCOPE PAGE PER L'UTILIZZO CON LE TAGLIBS PER L'OUTPUT IN XML
        // LO UTILIZZO COME SE FOSSE UNA VARIABILE PER POI EFFETTUARE IL GIUSTO OUTPUT.
        // ######################## ENGLISH FOR JAVA.SUN FORUM #####################
        // "OUTPUT" AND "MESSAGE" ARE ATTRIBUTES SETTED TO CHOOSE WHICH XML NODE I WANT TO SELECT
        // FOR OUPUT.
        pageContext.setAttribute("output","login");
        pageContext.setAttribute("message",null);
        String output = "login";
        String action = request.getParameter("action");
        // Controllo che (1� if) esista il cookie NICKNAME e che contenga dei valori; poi controllo che (2� if)
        // I valori contenuti corrispondano a quelli della sessione corrente.
        if(cookies != null) {
            if(Session.getValue(cookies,"NICKNAME",0) != null && Session.getValue(cookies,"NICKNAME",1) != null){
                if(Session.getValue(cookies,"NICKNAME",0).equals(loginManagement.getNickName())
                && Session.getValue(cookies,"NICKNAME",1).equals(loginManagement.getSessionID())) {
                    loginManagement.setLoggedOn(true);
        if(action != null){
            if(action.equals("login")){
                loginManagement.logon();
                if(loginManagement.getCookies() != null){
                    for(int i=0;i<loginManagement.getCookies().length;i++){
                        response.addCookie(loginManagement.getCookies(i));
                        cookies=loginManagement.getCookies();                   
                    loginManagement.setLoggedOn(true);
            if(action.equals("logout")){
                loginManagement.setCookies(cookies);
                loginManagement.logout();
                // Rispedisce i cookie al client con MaxAge = 0, cos� questi verranno cancellati.
                for(int i=0;i<loginManagement.getCookies().length;i++){
                    response.addCookie(loginManagement.getCookies(i));
                loginManagement.setLoggedOn(false);
        if(loginManagement.getLoggedOn()){
            // MOSTRA IL MESSAGGIO DI BENVENUTO (SHOWS THE WELCOME MESSAGE)
            pageContext.setAttribute("output","welcome");
            output = "welcome";
        else {
            if(action != null && action.equals("logout")){
                // TORNA ALL'INIZIO (SHOWS THE LOGIN FORM)
                pageContext.setAttribute("output","login");
                output = "login";
            else {
                if(loginManagement.getResult() == -1){
                    throw new Exception("Errore nell'applicazione: consultare i log");       
                if(loginManagement.getResult() == -2){
                    // STAMPA IL MESSAGGIO DI ERRORE (PRINTS THE ERROR MESSAGE)
                    pageContext.setAttribute("message",loginManagement.getErrorCode());
    %>############# END OF SCRIPTLETS' SECTION ###########
    now i'll paste 2 short taglibs sections which will be appended after the code i pasted above: the first working, the second not compiling:
    ################## FIRST TAGLIB SECTION #############
    <c:set var="xmlDocument" scope="page">
        <ROOT>
        <%if(output.equals("welcome")){%>
            <WELCOME>
                <NOME><%=loginManagement.getNome()%></NOME>
                <COGNOME><%=loginManagement.getCognome()%></COGNOME>
                <CREDITI><%=loginManagement.getCrediti()%></CREDITI>
            </WELCOME>
        <%}%>
        <%if(output.equals("login")){%>
            <LOGIN></LOGIN>
        <%}%>
        <%if(output.equals("error")){%>
            <ERROR><%=loginManagement.getErrorCode()%></ERROR>
        <%}%>
        </ROOT>
    </c:set>
    <x:parse xml="${xmlDocument}" var="xml"/>
    <c:set var="xslUrl"><%="/XSL/Login.xsl"%></c:set>
    <c:import var="xslDocument" url="${xslUrl}" scope="page"></c:import>
    <x:parse var="xsl" xml="${xslDocument}"/>
    <x:transform xml="${xml}" xslt="${xsl}"/>###################### END #########################
    ################## SECOND TAGLIB SECTION ###########
    <c:set var="xmlDocument" scope="page">
        <ROOT>
        <c:if test="${pageScope.output == 'welcome'}">
            <WELCOME>
                <NOME><c:out value="${loginManagement.nome}"></c:out></NOME>
                <COGNOME><c:out value="${loginManagement.cognome}"></c:out></COGNOME>
                <CREDITI><c:out value="${loginManagement.crediti}"></c:out></CREDITI>
            </WELCOME>
        </c:if>
        <c:if test="${pageScope.output == 'login'}">
            <LOGIN></LOGIN>
        </c:if>
        <c:if test="${pageScope.message != null }">
            <ERROR><c:out value="${loginManagement.errorCode}"></c:out></ERROR>
        </c:if>
        </ROOT>
    </c:set>
    <x:parse xml="${xmlDocument}" var="xml"/>
    <c:set var="xslUrl"><%="/XSL/Login.xsl"%></c:set>
    <c:import var="xslDocument" url="${xslUrl}" scope="page"></c:import>
    <x:parse var="xsl" xml="${xslDocument}"/>
    <x:transform xml="${xml}" xslt="${xsl}"/>###################### END #########################
    can u help me to understand why the second section doesn't works? if i'll be ogliged to use the first one, i won't be able to completely write code using taglibs, and so my code will be horrible! a mix of scriptlets syntax and taglibs' xml one.
    Compiling jsp with netbeans 4.0 the error is:
    Compiling 1 source file to /home/ghido/WebProjects/WebDocumentationXML/build/generated/classes
    /home/ghido/WebProjects/WebDocumentationXML/build/generated/src/org/apache/jsp/Login_jsp.java:252: jspxmeth_c_if_0(javax.servlet.jsp.tagext.JspTag,javax.servlet.jsp.PageContext) in org.apache.jsp.Login_jsp cannot be applied to (org.apache.taglibs.standard.tag.el.core.SetTag,javax.servlet.jsp.PageContext)
    if (_jspx_meth_c_if_0(_jspx_th_c_set_0, jspxpage_context))
    ^
    /home/ghido/WebProjects/WebDocumentationXML/build/generated/src/org/apache/jsp/Login_jsp.java:256: jspxmeth_c_if_1(javax.servlet.jsp.tagext.JspTag,javax.servlet.jsp.PageContext) in org.apache.jsp.Login_jsp cannot be applied to (org.apache.taglibs.standard.tag.el.core.SetTag,javax.servlet.jsp.PageContext)
    if (_jspx_meth_c_if_1(_jspx_th_c_set_0, jspxpage_context))
    ^
    /home/ghido/WebProjects/WebDocumentationXML/build/generated/src/org/apache/jsp/Login_jsp.java:260: jspxmeth_c_if_2(javax.servlet.jsp.tagext.JspTag,javax.servlet.jsp.PageContext) in org.apache.jsp.Login_jsp cannot be applied to (org.apache.taglibs.standard.tag.el.core.SetTag,javax.servlet.jsp.PageContext)
    if (_jspx_meth_c_if_2(_jspx_th_c_set_0, jspxpage_context))
    ^
    /home/ghido/WebProjects/WebDocumentationXML/build/generated/src/org/apache/jsp/Login_jsp.java:292: jspxmeth_c_out_0(javax.servlet.jsp.tagext.JspTag,javax.servlet.jsp.PageContext) in org.apache.jsp.Login_jsp cannot be applied to (org.apache.taglibs.standard.tag.el.core.IfTag,javax.servlet.jsp.PageContext)
    if (_jspx_meth_c_out_0(_jspx_th_c_if_0, jspxpage_context))
    ^
    /home/ghido/WebProjects/WebDocumentationXML/build/generated/src/org/apache/jsp/Login_jsp.java:296: jspxmeth_c_out_1(javax.servlet.jsp.tagext.JspTag,javax.servlet.jsp.PageContext) in org.apache.jsp.Login_jsp cannot be applied to (org.apache.taglibs.standard.tag.el.core.IfTag,javax.servlet.jsp.PageContext)
    if (_jspx_meth_c_out_1(_jspx_th_c_if_0, jspxpage_context))
    ^
    /home/ghido/WebProjects/WebDocumentationXML/build/generated/src/org/apache/jsp/Login_jsp.java:300: jspxmeth_c_out_2(javax.servlet.jsp.tagext.JspTag,javax.servlet.jsp.PageContext) in org.apache.jsp.Login_jsp cannot be applied to (org.apache.taglibs.standard.tag.el.core.IfTag,javax.servlet.jsp.PageContext)
    if (_jspx_meth_c_out_2(_jspx_th_c_if_0, jspxpage_context))
    ^
    /home/ghido/WebProjects/WebDocumentationXML/build/generated/src/org/apache/jsp/Login_jsp.java:404: jspxmeth_c_out_3(javax.servlet.jsp.tagext.JspTag,javax.servlet.jsp.PageContext) in org.apache.jsp.Login_jsp cannot be applied to (org.apache.taglibs.standard.tag.el.core.IfTag,javax.servlet.jsp.PageContext)
    if (_jspx_meth_c_out_3(_jspx_th_c_if_2, jspxpage_context))
    ^
    7 errors
    Can you help me??
    And also, is the "pageContext.setAttribute()" method the correct way to select output as i did, or do u know a better one?
    Thanks a lot, bye.

    Use the brace notation.
    ${sessionScope['org.apache.struts.action.LOCALE']}

  • How to display URL images and URL link (html) from Smartforms?

    Hi Gurus,
    I'm having difficulty on how to display targeted URL images and URL link from the smartforms, after i sending it out as html mail. The mail i sent just can be preview as a plain text, which can't execute the html code that i put inside the smartforms itself. I follow a few step from this very useful blog.. Hopefully, you guys can give me some solutions or ideas on this.
    /people/pavan.bayyapu/blog/2005/08/30/sending-html-email-from-sap-crmerp -thanks to Pavan for his useful blog.
    My code is like this..
    <--- Start Code.
    FORM call_smartforms.
      DATA : lv_subject TYPE so_obj_des,
             lc_true(1) VALUE 'X',
             lw_control_parameters TYPE ssfctrlop,
             lw_output_options TYPE ssfcompop,
             lc_graphics(8) VALUE 'GRAPHICS',
             lw_xsfparam_line TYPE ssfxsfp,
             lc_extract(7) VALUE 'EXTRACT',
             lc_graphics_directory(18) VALUE 'GRAPHICS-DIRECTORY',
             lc_mygraphics(11) VALUE 'mygraphics/',
             lc_content_id(10) VALUE 'CONTENT-ID',
             lc_enable(6) VALUE 'ENABLE',
             lw_job_output_info TYPE ssfcrescl,
             lw_html_data TYPE trfresult,
             lw_graphics TYPE ssf_xsf_gr,
             lt_graphics TYPE tsf_xsf_gr,
             lv_html_xstr TYPE xstring,
             lw_html_raw LIKE LINE OF lw_html_data-content,
             lv_incode TYPE tcp00-cpcodepage VALUE '4110',
             lv_html_str TYPE string,
             lv_html_len TYPE i,
             lc_utf8(5) VALUE 'utf-8',
             lc_latin1(6) VALUE 'latin1',
             lv_offset TYPE i,
             lv_length TYPE i,
             lv_diff TYPE i,
             lt_soli TYPE soli_tab,
             lw_soli TYPE soli,
             lc_mime_helper TYPE REF TO cl_gbt_multirelated_service,
             lv_name TYPE mime_text VALUE 'sapwebform.htm',
             lv_xstr TYPE xstring,
             lw_raw TYPE bapiconten,
             lt_solix TYPE solix_tab,
             lw_solix TYPE solix,
             lv_filename TYPE string,
             lv_content_id TYPE string,
             lv_content_type TYPE w3conttype,
             lv_obj_len TYPE so_obj_len,
             lv_bmp TYPE so_fileext VALUE 'BMP',
             lv_description TYPE so_obj_des VALUE 'Graphic in BMP format',
             lc_doc_bcs TYPE REF TO cl_document_bcs,
             lc_bcs TYPE REF TO cl_bcs,
             lc_send_exception TYPE REF TO cx_root,
             lw_adsmtp TYPE lty_adsmtp,
             lv_mail_address TYPE ad_smtpadr,
             lc_recipient TYPE REF TO if_recipient_bcs,
             lc_send_request TYPE REF TO cl_bcs,
             lv_sent_to_all TYPE os_boolean.
      DATA : v_language TYPE sflangu VALUE 'E',
             v_e_devtype TYPE rspoptype.
      v_form_name = 'ZTEST_EMAIL'.
      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
        EXPORTING
          formname           = v_form_name
        IMPORTING
          fm_name            = v_namef
        EXCEPTIONS
          no_form            = 1
          no_function_module = 2
          OTHERS             = 3.
      IF sy-subrc = 0.
       break mhusin.
      ENDIF.
    starting here. ***
    Set title for the output
      lv_subject = 'Smartforms.'.
    Set control parameters to "no dialog"
      lw_control_parameters-no_dialog = lc_true.
    IF lw_service_subject-code = lc_fm1.
    *--- To get output device type
      CALL FUNCTION 'SSF_GET_DEVICE_TYPE'
        EXPORTING
          i_language    = v_language
          i_application = 'SAPDEFAULT'
        IMPORTING
          e_devtype     = v_e_devtype.
      lw_output_options-tdprinter = v_e_devtype.
      lw_control_parameters-getotf = 'X'.
      IF sy-subrc = 0.
       break mhusin.
      ENDIF.
    Set output options
      lw_output_options-xsf        = lc_true.
      lw_output_options-xsfcmode   = lc_true.
      lw_output_options-xsfoutmode = 'A'.
      lw_output_options-xsfoutdev  = space.
      lw_output_options-xsfformat  = lc_true.
      lw_xsfparam_line-name  = lc_graphics.
      lw_xsfparam_line-value = lc_extract.
      APPEND lw_xsfparam_line TO lw_output_options-xsfpars.
      lw_xsfparam_line-name  = lc_graphics_directory.
      lw_xsfparam_line-value = lc_mygraphics.
      APPEND lw_xsfparam_line TO lw_output_options-xsfpars.
      lw_xsfparam_line-name  = lc_content_id.
      lw_xsfparam_line-value = lc_enable.
      APPEND lw_xsfparam_line TO lw_output_options-xsfpars.
    Get the smartform content
      CALL FUNCTION v_namef
        EXPORTING
          control_parameters   = lw_control_parameters
          output_options       = lw_output_options
    *pass other application specific parameters (eg order number, items ).
      IMPORTING
          job_output_info    = lw_job_output_info
      TABLES
          tt_tabh              = tt_tabh
          tt_tabb              = tt_tabb
          tt_tabf              = tt_tabf
      EXCEPTIONS
          formatting_error = 1
          internal_error   = 2
          send_error       = 3
          user_canceled    = 4
          OTHERS           = 5.
      IF sy-subrc = 0.
       break mhusin.
      ENDIF.
      lw_html_data  = lw_job_output_info-xmloutput-trfresult.
      lt_graphics[] = lw_job_output_info-xmloutput-xsfgr[].
      CLEAR lv_html_xstr.
      LOOP AT lw_html_data-content INTO lw_html_raw.
        CONCATENATE lv_html_xstr lw_html_raw INTO lv_html_xstr IN BYTE MODE.
      ENDLOOP.
      lv_html_xstr = lv_html_xstr(lw_html_data-length).
      CALL FUNCTION 'SCP_TRANSLATE_CHARS'
        EXPORTING
          inbuff       = lv_html_xstr
          incode       = lv_incode
          csubst       = lc_true
          substc_space = lc_true
        IMPORTING
          outbuff      = lv_html_str
          outused      = lv_html_len
        EXCEPTIONS
          OTHERS       = 1.
    *HACK THE HTML CODE GENERATED BY SMARTFORM TO MAKE THE
    *EXTERNAL IMAGES APPEAR AS <IMG> TAG IN HTML
      REPLACE ALL OCCURRENCES OF '<IMG' IN lv_html_str WITH '<IMG' IGNORING CASE.
      REPLACE ALL OCCURRENCES OF '/>' IN lv_html_str WITH '/>' IGNORING CASE.
      REPLACE ALL OCCURRENCES OF '</A>' IN lv_html_str WITH '' IGNORING CASE.
      REPLACE ALL OCCURRENCES OF '<' IN lv_html_str WITH '<' IGNORING CASE.
      REPLACE ALL OCCURRENCES OF '>' IN lv_html_str WITH '>' IGNORING CASE.
    CALL METHOD html_control - >load_mime_object
       EXPORTING
         object_id  = 'ZWN'
         object_url = 'ZWN.GIF'
       EXCEPTIONS
         OTHERS     = 1.
      REPLACE ALL OCCURRENCES OF lc_utf8 IN lv_html_str WITH lc_latin1.
    REPLACE ALL OCCURRENCES OF lc_utf8 IN lv_html_str WITH 'iso-8859-1'.
       break mhusin.
      lv_html_len = STRLEN( lv_html_str ).
      lv_offset = 0.
      lv_length = 255.
      WHILE lv_offset < lv_html_len.
        lv_diff = lv_html_len - lv_offset.
        IF lv_diff > lv_length.
          lw_soli-line = lv_html_str+lv_offset(lv_length).
        ELSE.
          lw_soli-line = lv_html_str+lv_offset(lv_diff).
        ENDIF.
        APPEND lw_soli TO lt_soli.
        ADD lv_length TO lv_offset.
      ENDWHILE.
      CREATE OBJECT lc_mime_helper.
      CALL METHOD lc_mime_helper->set_main_html
        EXPORTING
          content     = lt_soli
          filename    = lv_name
          description = lv_subject.
      LOOP AT lt_graphics INTO lw_graphics.
        CLEAR lv_xstr.
        LOOP AT lw_graphics-content INTO lw_raw.
          CONCATENATE lv_xstr lw_raw-line INTO lv_xstr IN BYTE MODE.
        ENDLOOP.
        lv_xstr = lv_xstr(lw_graphics-length).
        lv_offset = 0.
        lv_length = 255.
        CLEAR lt_solix[].
        WHILE lv_offset < lw_graphics-length.
          lv_diff = lw_graphics-length - lv_offset.
          IF lv_diff > lv_length.
            lw_solix-line = lv_xstr+lv_offset(lv_length).
          ELSE.
            lw_solix-line = lv_xstr+lv_offset(lv_diff).
          ENDIF.
          APPEND lw_solix TO lt_solix.
          ADD lv_length TO lv_offset.
        ENDWHILE.
        CONCATENATE lc_mygraphics lw_graphics-graphics text-001 INTO lv_filename.
        CONCATENATE lc_mygraphics lw_graphics-graphics text-001 INTO lv_content_id.
        lv_content_type = lw_graphics-httptype.
        lv_obj_len      = lw_graphics-length.
    *Add images to the email
        CALL METHOD lc_mime_helper->add_binary_part
          EXPORTING
            content      = lt_solix
            filename     = lv_filename
            extension    = lv_bmp
            description  = lv_description
            content_type = lv_content_type
            length       = lv_obj_len
            content_id   = lv_content_id.
      ENDLOOP.
      TRY.
          lv_subject = lv_subject.
          lc_doc_bcs = cl_document_bcs=>create_from_multirelated(
                   i_subject          = lv_subject
                   i_multirel_service = lc_mime_helper ).
        CATCH cx_document_bcs INTO lc_send_exception.
        CATCH cx_bcom_mime INTO lc_send_exception.
        CATCH cx_gbt_mime INTO lc_send_exception.
      ENDTRY.
    Create send request
      TRY.
          lc_bcs = cl_bcs=>create_persistent( ).
        CATCH cx_send_req_bcs INTO lc_send_exception.
      ENDTRY.
      TRY.
          lc_bcs->set_document( i_document = lc_doc_bcs ).
        CATCH cx_send_req_bcs INTO lc_send_exception.
      ENDTRY.
    Set-up email receiver
      lv_mail_address = '[email protected]'.
    TRANSLATE lv_mail_address TO UPPER CASE.
      TRY.
          lc_recipient = cl_cam_address_bcs=>create_internet_address(
              i_address_string = lv_mail_address ).
        CATCH cx_address_bcs INTO lc_send_exception.
      ENDTRY.
      TRY.
          lc_bcs->add_recipient( i_recipient = lc_recipient ).
        CATCH cx_send_req_bcs INTO lc_send_exception.
      ENDTRY.
    Send smartforms as HTML email
      TRY.
          lc_bcs->send( ).
        CATCH cx_send_req_bcs INTO lc_send_exception.
      ENDTRY.
      COMMIT WORK.
      WRITE:/ 'Mail sent'.
    ENDFORM.                    "call_smartforms
    End Code --->
    Thanks and Regards.

    1- put your images in a directory under the web app directory. Example: app/images/
    2- in your jsp, use: String file = application.getRealPath("/images/"); to get the images directory. See http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/ServletContext.html#getRealPath(java.lang.String)
    3- it's not the right forum to post this kind of question. Post them in the JSP/Servlet JSTL forum instead

  • Problem with % signs in key value url parameter pairs

    Hi,
    Tomcat 5.5.9
    Java Version 1.5
    I'm having a little difficulty passing a certain key value pair via a URL to the processing component of my web application.
    If I submit a value for lets say parameter 'product_name' and that value starts with a % sign then the value is passed to my processing component as 'null' if I remove the % sign the value is correctly received.
    Anyone come accross this on a Tomcat server?
    The data has to be tagged onto the URL rather than as a form 'Post', as it is used to create and populate a popup window.
    Thanks in advance.

    So the % is used in URLs to mark certain escape sequences, so when you put it in you value, it thinks that the value is actually an escape sequence, and probably translates poorly on the opposite side.
    You will actually need to use the escape sequence for the % sign to get it work correctly. I don't recall the actual escape value, but:
    If you use JSTL to put together the URL for you, you shouldn't have a problem, the values will be escapes:
    <c:url var="popupAddress" url="http://www.mydomain.com/myapp/mupage.jsp">
      <c:param name="product_name" value="%Whatever"/>
    </c:url>
    <script type="text/javascript">
      document.open("<c:out value="${popupAddress}"/>","Popup");
    </script>

  • Not able to connect to database(MS SQL Server 2000) through JSTL tag

    Hi,
    I just want to retrieve some data from the database through a JSP page.I am using JSTL tags the code is as shown below. Whenever i execute this code i get an error message like this
    My Code:
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
    <%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql_rt" %>
    <sql:setDataSource var="datasource"
    driver="com.microsoft.jdbc.sqlserver.SQLServerDriver"
    url="jdbc:mssqlserver:sqlserver://SYS57:1433;DatabaseName= sree"
         user=" "
         password=" "/>
    <sql:query var="res" dataSource="${datasource}">
    SELECT * FROM books
    </sql:query>
    <html>
      <head>
        <title>A First JSP Database</title>
      </head>
      <body>
        <table border="1">
          <tr>
            <td>id</td><td>title</td><td>price</td>
          </tr>
          <c:forEach items="${res.rows}" var="row">
          <tr>
            <td><c:out value="${row.id}" /></td>
            <td><c:out value="${row.name}" /></td>
            <td><c:out value="${row.author}" /></td>
          </tr>
          </c:forEach>
        </table>
      </body>
    </html>error is this:
    javax.servlet.ServletException: Unable to get connection, DataSource invalid: "No suitable driver"
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:848)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781)
         org.apache.jsp.firstdb_jsp._jspService(org.apache.jsp.firstdb_jsp:93)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)root cause
    javax.servlet.jsp.JspException: Unable to get connection, DataSource invalid: "No suitable driver"
         org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.getConnection(QueryTagSupport.java:308)
         org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.doStartTag(QueryTagSupport.java:192)
         org.apache.jsp.firstdb_jsp._jspx_meth_sql_query_0(org.apache.jsp.firstdb_jsp:132)
         org.apache.jsp.firstdb_jsp._jspService(org.apache.jsp.firstdb_jsp:68)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)I am not clear with url attribute of setDatasource tag... I feel the error is because of that line only..... Kindly tell me how to specify the jdbc URL for MS SQL Server 2000 while using JSTL tags for connection.
    Thanks,
    Akshatha

    unable to rectify the error........ tried lot but all in vain...still trying........
    my current code is:
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
    <%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql_rt" %>
    <sql:setDataSource var="datasource" driver="com.microsoft.jdbc.sqlserver.SQLServerDriver"
    url="jdbc:microsoft:sqlserver://SYS57:1433;databaseName=sree" user="sa"
             password="dfgdfg"/>
    <sql:query var="res" dataSource="${datasource}">
      SELECT * FROM books
    </sql:query>
    <html>
      <head>
        <title>A First JSP Database</title>
      </head>
      <body>
        <table border="1">
          <tr>
            <td>id</td><td>title</td><td>price</td>
          </tr>
          <c:forEach items="${res.rows}" var="row">
          <tr>
            <td><c:out value="${row.id}" /></td>
            <td><c:out value="${row.name}" /></td>
            <td><c:out value="${row.author}" /></td>
          </tr>
          </c:forEach>
        </table>
      </body>
    </html>Thanks,
    Akshatha

Maybe you are looking for

  • Redirecting an item value to another page..

    Hi, I am trying to auto-populate couple of values on page 2 when I click a button on page 1. Tried setting the item values using the comma separated list and also by re-directing to an url. Hit an issue when the values that need to be set itself cont

  • Populating the custom filed - added in BOM item.

    Hello Friends, I have a requirement like, for the custom field added in BOM item data, it should come filled while executing the CS02/CS03/CS12/CS73....transactions. I have added a field which is one of the field from MARA table. what I have to do is

  • How do i access apps purchased on other apple devices from Mac

    Can you access purchased games in my iCloud account via my Mac?

  • What is the best possible battery configuration on thinkpad x230?

    I am leaning towards buying a Lenovo thinkpad x230 with 6 cell main battery as well as a 44++ 9 cell battery and a 19+ six cell battery configuration (6 +9+6 cell battery configuration). My queries are 1. Can all three of the batteries work in conjun

  • Import Configuration error

    Hello I have created a new software component, product as well. Created a new development track for the same. Addedd all the needed dependencies as well. However when i try importing the same into NWDS via import configuration I get the following err