Visual Web JSF Portlet Upload file Problem in Websynergy

Hello,
I am using Websynergy milestone 3 release. I have tried to build AS A PORTLET the sample code, "Uploading Files in NetBeans Visual Web JSF Applications" (http://www.netbeans.org/kb/60/web/intro.html) using netbeans 6.5. The solution deploys successfully but unfortunately, the file Upload control does not work in the websynergy portlet environment. No file seems to be uploaded. The same code works very well in non-portlet environment. Is there a work-around for the Portlet environment?
Looking forward to some help!
Pius

Hello,
I am using Websynergy milestone 3 release. I have tried to build AS A PORTLET the sample code, "Uploading Files in NetBeans Visual Web JSF Applications" (http://www.netbeans.org/kb/60/web/intro.html) using netbeans 6.5. The solution deploys successfully but unfortunately, the file Upload control does not work in the websynergy portlet environment. No file seems to be uploaded. The same code works very well in non-portlet environment. Is there a work-around for the Portlet environment?
Looking forward to some help!
Pius

Similar Messages

  • Visual Web JSF and Java Script problem

    Hi i am using Visual Web JSF for development in my project. AJAX to update data from server when users enters data in one text box its an chat application. i am getting data from server but unable to update my <webuijsf:textarea> component with the new data on my chat page ... I am facing another problem in java script that it is not accepting relational operators (< . >) in JSF Application.... i am attaching some code here for reference...result =http.responseText.split(","); /// this is the response text from AJAX based call
    var obj=document.getElementById('form1:chatter_box'); /// this text area is to be updated...
    var txt=document.createTextNode(http.responseText);
    ///document.getElementById('form1:chatter_box').innerHTML = txt;
    for(i=0;i < size;i++){
    var txt1=document.createTextNode(result);
    obj.appendChild(txt1);

    Try changing onclick to onClick and try...
    regards
    shanu

  • We can use JSR-168 JPS portlet upload file,

    We can use JSR-168 JPS portlet upload file,
    here is the source for you referrence:
    upload file can use JSR168 portlet,
    1,CustomizablePortlet.java File
    import java.io.IOException;
    import java.io.PrintWriter;
    import java.util.ResourceBundle;
    import javax.portlet.*;
    import oracle.webdb.utils.SimpleStringBuffer;
    public class CustomizablePortlet extends GenericPortlet {
    private static final String TITLE_KEY = "title";
    protected static final String OK_ACTION = "ok_action";
    protected static final String APPLY_ACTION = "apply_action";
    protected static final PortletMode PREVIEW_MODE = new PortletMode("preview");
    protected static final PortletMode EDIT_DEFAULTS_MODE = new PortletMode("EDIT_DEFAULTS");
    protected static final PortletMode ABOUT_MODE = new PortletMode("ABOUT");
    public CustomizablePortlet() {
    public String getTitle(RenderRequest request) {
    return request.getPreferences().getValue("title", getPortletConfig().getResourceBundle(request.getLocale()).getString("javax.portlet.title"));
    public void doEdit(RenderRequest request, RenderResponse response) throws PortletException, IOException {
    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    out.print("<FORM ACTION=\"");
    out.print(getEditFormSubmitURL(request, response));
    out.println("\" METHOD=\"POST\">");
    out.println("<TABLE BORDER=\"0\">");
    out.println("<TR>");
    out.println("<TD WIDTH=\"20%\">");
    out.println("<P CLASS=\"portlet-form-field\" ALIGN=\"RIGHT\">Title:");
    out.println("</TD>");
    out.println("<TD WIDTH=\"80%\">");
    out.print("<INPUT CLASS=\"portlet-form-input-field\" TYPE=\"TEXT\" NAME=\"");
    out.print("title");
    out.print("\" VALUE=\"");
    out.print(getTitle(request));
    out.println("\" SIZE=\"20\">");
    out.println("</TD>");
    out.println("</TR>");
    out.println("<TR>");
    out.println("<TD COLSPAN=\"2\" ALIGN=\"CENTER\">");
    out.print("<INPUT CLASS=\"portlet-form-button\" TYPE=\"SUBMIT\" NAME=\"");
    out.print("ok_action");
    out.print("\" VALUE=\"OK\">");
    out.print("<INPUT CLASS=\"portlet-form-button\" TYPE=\"SUBMIT\" NAME=\"");
    out.print("apply_action");
    out.print("\" VALUE=\"Apply\">");
    out.println("</TD>");
    out.println("</TR>");
    out.println("</TABLE>");
    out.println("</FORM>");
    protected String getEditFormSubmitURL(RenderRequest request, RenderResponse response) {
    return response.createActionURL().toString();
    public void doHelp(RenderRequest request, RenderResponse response) throws PortletException, IOException {
    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    out.print("Help for <i><b>");
    out.print(getTitle(request));
    out.println("</b></i>.");
    public void doAbout(RenderRequest request, RenderResponse response) throws PortletException, IOException {
    String aboutHTML = (new SimpleStringBuffer(30)).append("/about_").append(getPortletName()).append(".html").toString();
    PortletRequestDispatcher rd = getPortletContext().getRequestDispatcher(aboutHTML);
    response.setContentType("text/html");
    if(rd != null) {
    rd.include(request, response);
    } else {
    PrintWriter out = response.getWriter();
    out.print("<p class=\"portlet-font\">This is the about page for ");
    out.print(getTitle(request));
    out.print(".</p><p class=\"portlet-font\">");
    out.print("To customize the contents of this page, create a file named '");
    out.print(aboutHTML.substring(1));
    out.print("' in the Portlet web application's root directory containing HTML ");
    out.print("to appear here. ");
    out.print("Alternatively, override the <code>CustomizablePortlet</code> ");
    out.println("class's <code>doAbout()</code> method.</p>");
    public void doDispatch(RenderRequest request, RenderResponse response) throws PortletException, IOException {
    WindowState state = request.getWindowState();
    if(!state.equals(WindowState.MINIMIZED)) {
    PortletMode mode = request.getPortletMode();
    if(mode.equals(PREVIEW_MODE))
    doView(request, response);
    else
    if(mode.equals(EDIT_DEFAULTS_MODE))
    doEdit(request, response);
    else
    if(mode.equals(ABOUT_MODE))
    doAbout(request, response);
    else
    super.doDispatch(request, response);
    } else {
    super.doDispatch(request, response);
    public void processAction(ActionRequest request, ActionResponse actionResponse) throws PortletException, IOException {
    String newTitle = request.getParameter("title");
    PortletPreferences prefs = request.getPreferences();
    prefs.setValue("title", newTitle);
    prefs.store();
    if(request.getParameter("ok_action") != null) {
    actionResponse.setPortletMode(PortletMode.VIEW);
    actionResponse.setWindowState(WindowState.NORMAL);
    2,FileUploadPortlet.java file
    import java.io.*;
    import javax.activation.DataHandler;
    import javax.mail.MessagingException;
    import javax.mail.internet.MimeBodyPart;
    import javax.portlet.*;
    import oracle.portal.portlet.sample.CustomizablePortlet;
    public class FileUploadPortlet extends CustomizablePortlet
    private static final String FILE_PARAM = "file";
    private static final String SUBMIT_PARAM = "submit";
    private static final String DEFAULT_CHARSET = "ISO-8859-1";
    private static final String uploadRoot = "";
    public FileUploadPortlet()
    public void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException {
    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    out.print("<form action=\"");
    out.print(response.createActionURL().toString());
    out.println("\" enctype=\"multipart/form-data\" method=\"post\">");
    out.println("<center><table border=\"0\">");
    out.println("<tr>");
    out.print("<td class=\"portlet-form-field\" align=\"right\">");
    out.print("Please browse to an HTML file:");
    out.println("</td>");
    out.print("<td>");
    out.print("<input class=\"portlet-form-input-field\" type=\"file\" name=\"");
    out.print("file");
    out.print("\">");
    out.println("</td>");
    out.println("</tr>");
    out.println("<tr>");
    out.println("<td colspan=\"2\" align=\"center\">");
    out.print("<input type=\"submit\" class=\"portlet-form-button\" name=\"");
    out.print("submit");
    out.print("\" value=\"Display\">");
    out.println("</td>");
    out.println("</tr>");
    out.println("</table>");
    out.println("</form>");
    String lastFile = request.getPreferences().getValue("file", null);
    if(lastFile != null) {
    out.println("<hr width=\"100%\"><br>");
    out.print(lastFile);
    public void processAction(ActionRequest request, ActionResponse actionResponse) throws PortletException, IOException {
    FormDataParser parsedRequest = new FormDataParser(request);
    MimeBodyPart mbp = parsedRequest.getMimeBodyPart("file");
    if(mbp == null)
    super.processAction(request, actionResponse);
    else
    try {
    String fileName= mbp.getFileName();
    int splash = fileName.lastIndexOf("\\");
    if(splash != -1)
    fileName = fileName.substring(splash +1, fileName.length()).trim();
    String contentType = mbp.getContentType();
    String charSet = getCharsetFromContentType(contentType);
    int sepIndex = contentType.indexOf(';');
    if(sepIndex != -1)
    contentType = contentType.substring(0, sepIndex).trim();
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    mbp.getDataHandler().writeTo(bos);
    bos.close();
    String content = new String(bos.toByteArray(), charSet);
    FileOutputStream fos = new FileOutputStream(fileName);
    fos.write(bos.toByteArray());
    fos.close();
    PortletPreferences prefs = request.getPreferences();
    prefs.setValue("file", fileName + "upload ok");
    prefs.store();
    catch(MessagingException me) {
    throw new PortletException(me);
    public static String getCharsetFromContentType(String contentType) {
    int lastPos;
    if((lastPos = contentType.indexOf(';')) == -1)
    return "ISO-8859-1";
    lastPos++;
    String lowerContentType = contentType.toLowerCase();
    int nextPos;
    do {
    nextPos = lowerContentType.indexOf(';', lastPos);
    String param;
    if(nextPos == -1)
    param = lowerContentType.substring(lastPos).trim();
    else
    param = lowerContentType.substring(lastPos, nextPos).trim();
    if(param.startsWith("charset=") && param.length() > 8)
    return param.substring(8);
    lastPos = nextPos + 1;
    } while(nextPos != -1);
    return "ISO-8859-1";
    3,FormDataParser.java file
    import java.io.*;
    import java.util.*;
    import javax.activation.DataSource;
    import javax.mail.MessagingException;
    import javax.mail.internet.MimeBodyPart;
    import javax.mail.internet.MimeMultipart;
    import javax.portlet.ActionRequest;
    import javax.portlet.PortletException;
    public class FormDataParser {
    private static final String MULTIPART_PREFIX = "multipart/";
    private static final String MULTIPART_FORM_DATA = "multipart/form-data";
    private static final String PLAIN_TEXT = "text/plain";
    private ActionRequest mWrappedRequest;
    private Map mParams;
    private Map mBodyParts;
    private boolean mIsInitialized;
    private boolean mHasMultipart;
    public FormDataParser(ActionRequest request) {
    mWrappedRequest = request;
    public String getParameter(String name) throws PortletException {
    String value = mWrappedRequest.getParameter(name);
    if(value != null)
    return value;
    initParameters();
    if(!mHasMultipart)
    return null;
    List paramList = (List)mParams.get(name);
    if(paramList != null)
    return (String)paramList.get(0);
    else
    return null;
    public String[] getParameterValues(String name) throws PortletException {
    String values[] = mWrappedRequest.getParameterValues(name);
    if(!mHasMultipart)
    return values;
    initParameters();
    List valueList = (List)mParams.get(name);
    if(valueList == null)
    return values;
    int size = valueList.size();
    if(values != null) {
    List newValueList = new ArrayList(values.length + size);
    newValueList.addAll(Arrays.asList(values));
    newValueList.addAll(valueList);
    valueList = newValueList;
    values = new String[size];
    valueList.toArray(values);
    return values;
    public MimeBodyPart getMimeBodyPart(String name) throws PortletException {
    initParameters();
    if(!mHasMultipart) {
    return null;
    } else {
    List parts = (List)mBodyParts.get(name);
    return parts != null ? (MimeBodyPart)parts.get(0) : null;
    public MimeBodyPart[] getMimeBodyParts(String name) throws PortletException {
    initParameters();
    if(!mHasMultipart)
    return null;
    List parts = (List)mBodyParts.get(name);
    if(parts == null) {
    return null;
    } else {
    MimeBodyPart mimeBodyParts[] = new MimeBodyPart[parts.size()];
    parts.toArray(mimeBodyParts);
    return mimeBodyParts;
    private void initParameters() throws PortletException {
    if(mIsInitialized)
    return;
    String contentType = mWrappedRequest.getContentType();
    if(contentType == null) {
    mIsInitialized = true;
    return;
    int sepIndex = contentType.indexOf(';');
    if(sepIndex != -1)
    contentType = contentType.substring(0, sepIndex).trim();
    if(contentType.equalsIgnoreCase("multipart/form-data")) {
    mParams = new HashMap(20);
    mBodyParts = new HashMap(20);
    DataSource ds = new DataSource() {
    public InputStream getInputStream() throws IOException {
    return mWrappedRequest.getPortletInputStream();
    public OutputStream getOutputStream() throws IOException {
    throw new IOException("OutputStream not available");
    public String getContentType() {
    return mWrappedRequest.getContentType();
    public String getName() {
    return getClass().getName();
    try {
    MimeMultipart multipartMessage = new MimeMultipart(ds);
    parseMultiPart(multipartMessage, null);
    catch(MessagingException me) {
    throw new PortletException(me);
    catch(IOException ioe) {
    throw new PortletException(ioe);
    mHasMultipart = true;
    mIsInitialized = true;
    private void parseMultiPart(MimeMultipart multipartMessage, String parentFieldName) throws MessagingException, IOException {
    int partCount = multipartMessage.getCount();
    for(int i = 0; i < partCount; i++) {
    javax.mail.BodyPart part = multipartMessage.getBodyPart(i);
    if(part instanceof MimeBodyPart) {
    MimeBodyPart mimePart = (MimeBodyPart)part;
    String disps[] = mimePart.getHeader("Content-Disposition");
    if(disps != null && disps.length != 0) {
    String disp = disps[0];
    String lcDisp = disp.toLowerCase();
    int nameStart;
    int nameEnd;
    if((nameStart = lcDisp.indexOf("name=\"")) != -1 && (nameEnd = lcDisp.indexOf("\"", nameStart + 6)) != -1)
    parentFieldName = disp.substring(nameStart + 6, nameEnd);
    if(parentFieldName != null)
    if(mimePart.getContentType().toLowerCase().startsWith("multipart/")) {
    Object content = mimePart.getContent();
    if(content instanceof MimeMultipart)
    parseMultiPart((MimeMultipart)content, parentFieldName);
    } else
    if((nameStart = lcDisp.indexOf("filename=\"")) != -1 && (nameEnd = lcDisp.indexOf("\"", nameStart + 10)) != -1) {
    List values = (List)mBodyParts.get(parentFieldName);
    if(values == null) {
    values = new ArrayList(1);
    mBodyParts.put(parentFieldName, values);
    values.add(mimePart);
    } else
    if(mimePart.getContentType().toLowerCase().startsWith("text/plain")) {
    Object content = mimePart.getContent();
    if(content instanceof String) {
    List values = (List)mParams.get(parentFieldName);
    if(values == null) {
    values = new ArrayList(1);
    mParams.put(parentFieldName, values);
    values.add((String)content);
    4.web.xml file
    <?xml version = '1.0' encoding = 'ISO-8859-1'?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
    <display-name>hanhuiwen OracleSamplePortlets</display-name>
    <description>hanhuiwen Oracle Sample Portlet Application</description>
    <servlet>
    <servlet-name>portletdeploy</servlet-name>
    <servlet-class>oracle.webdb.wsrp.server.deploy.PortletDeployServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet>
    <servlet-name>portletjaxrpc</servlet-name>
    <servlet-class>com.sun.xml.rpc.server.http.JAXRPCServlet</servlet-class>
    <init-param>
    <param-name>configuration.file</param-name>
    <param-value>/WEB-INF/WSRPService_Config.properties</param-value>
    </init-param>
    </servlet>
    <servlet>
    <servlet-name>portletresource</servlet-name>
    <servlet-class>oracle.webdb.wsrp.server.ResourceServlet</servlet-class>
    </servlet>
    <servlet>
    <servlet-name>ChartServlet</servlet-name>
    <display-name>Chart Servlet</display-name>
    <description>Demo image-generating servlet</description>
    <servlet-class>oracle.portal.portlet.sample.chart.ChartServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet>
    <servlet-name>uix</servlet-name>
    <servlet-class>oracle.cabo.servlet.UIXServlet</servlet-class>
    <init-param>
    <param-name>oracle.cabo.servlet.pageBroker</param-name>
    <param-value>oracle.cabo.servlet.xml.UIXPageBroker</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>ChartServlet</servlet-name>
    <url-pattern>/chart*</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>portletjaxrpc</servlet-name>
    <url-pattern>/portlets*</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>portletresource</servlet-name>
    <url-pattern>/portletresource*</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>uix</servlet-name>
    <url-pattern>*.uix</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>uix</servlet-name>
    <url-pattern>/uix/*</url-pattern>
    </servlet-mapping>
    <session-config>
    <session-timeout>60</session-timeout>
    </session-config>
    <welcome-file-list>
    <welcome-file>index.uix</welcome-file>
    </welcome-file-list>
    <!--
    LogLevel controls the amount of information logged. There are 7 log levels:
    0 - logging disabled
    1 - configuration
    2 - severe error
    3 - warning
    4 - throwing exception
    5 - performance
    6 - information
    7 - debug
    The oracle.portal.log.Logger interface defines methods that map to these 7
    log levels. However, there are also 2 methods that do not map to log
    levels. These methods are included for backwards compatibility and data
    logged using these methods will always be logged regardless of the log level.
    -->
    <env-entry>
    <env-entry-name>oracle/portal/log/logLevel</env-entry-name>
    <env-entry-type>java.lang.Integer</env-entry-type>
    <env-entry-value>7</env-entry-value>
    </env-entry>
    </web-app>
    5.portlet.xml
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd" version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd">
    <portlet>
    <description xml:lang="en">A portlet that demonstrates the file upload features of the Java Portlet Specification.</description>
    <portlet-name>FileUpload</portlet-name>
    <portlet-class>FileUploadPortlet</portlet-class>
    <expiration-cache>0</expiration-cache>
    <supports>
    <mime-type>text/html</mime-type>
    <portlet-mode>help</portlet-mode>
    <portlet-mode>about</portlet-mode>
    <portlet-mode>edit_defaults</portlet-mode>
    </supports>
    <supported-locale>en</supported-locale>
    <portlet-info>
    <title>File Upload Portlet</title>
    <short-title>File Upload</short-title>
    <keywords>File,Upload, Portlet</keywords>
    </portlet-info>
    </portlet>
    <custom-portlet-mode>
    <description xml:lang="en">This mode should be used by the portlet to display information on the portlet's purpose, origin, version, etc.</description>
    <portlet-mode>about</portlet-mode>
    </custom-portlet-mode>
    <custom-portlet-mode>
    <description xml:lang="en">This mode signifies that the portlet should render a screen to set the default values for the modifiable preferences that are typically changed in the EDIT screen. Calling this mode requires that the user must have administrator rights.</description>
    <portlet-mode>edit_defaults</portlet-mode>
    </custom-portlet-mode>
    <custom-portlet-mode>
    <description xml:lang="en">This mode should be used by the portlet to render output without the need of having back-end connections or user specific data available.</description>
    <portlet-mode>preview</portlet-mode>
    </custom-portlet-mode>
    <user-attribute>
    <name>user.name.given</name>
    </user-attribute>
    <user-attribute>
    <name>user.name.family</name>
    </user-attribute>
    <user-attribute>
    <name>user.name.middle</name>
    </user-attribute>
    <user-attribute>
    <name>user.name.nickname</name>
    </user-attribute>
    <user-attribute>
    <name>user.bdate</name>
    </user-attribute>
    <user-attribute>
    <name>user.business-info.online.email</name>
    </user-attribute>
    </portlet-app>

    Hello i had exactly the same error, but not with file upload.
    I'm sure you have in your application lib directory to jars which aren't compatible to each other.
    And the problem occured between my myfaces and tomahawk jars .
    See this page:
    http://wiki.apache.org/myfaces/CompatibilityMatrix
    It tells you which myfaces and tomahawk jars you can use together.
    Hope it can help.
    bye

  • Visual Web JSF web app unable to render. The theme tries to access META-INF

    Hi,
    BACKGROUND: I have created a Netbeans 6 Visual Web Project using the default Visual Web JSF Theme. My web application can be viewed properly and correctly when i deploy it on tomcat 6.
    ARCHITECTURE: Our server configuration requires IIS to be our web server and tomcat to be our app server. Both are running on different machines. I have successfully linked up IIS 6 and tomcat 6 using the JK isapi_redirector.
    PROBLEM: However, when i connect to my app via IIS, my starting page opens but the input box components on that page are not displayed and i get several javascript errors that read - 'dojo is undefined' and 'webui is undefined'.
    PROBLEM DETAILS: I found that the page being served had a lot of files being requested from a META-INF folder. I have attached a snippet here.
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:wairole="http://www.w3.org/2005/01/wai-rdf/GUIRoleTaxonomy#" xmlns:waistate="http://www.w3.org/2005/07/aaa">
    <head>
    <title></title><link rel="stylesheet" type="text/css" href="/BMC/theme/com/sun/webui/jsf/suntheme4_1_1/css/css_master-all.css" /><link rel="stylesheet" type="text/css" href="/BMC/theme/com/sun/webui/jsf/suntheme4_1_1/css/ie.css" /><script type="text/javascript">var djConfig={"parseOnLoad":false,"isDebug":false}</script><script type="text/javascript" src="/BMC/theme/META-INF/json2_0/json.js"></script><script type="text/javascript" src="/BMC/theme/META-INF/prototype1_5/prototype.js"></script><script type="text/javascript" src="/BMC/theme/META-INF/com_sun_faces_ajax.js"></script><script type="text/javascript" src="/BMC/theme/META-INF/dojo1_0_1/dojo/dojo.js"></script><script type="text/javascript" src="/BMC/theme/META-INF/dojo1_0_1/dijit/dijit.js"></script><script type="text/javascript">dojo.registerModulePath("webui.suntheme", "/BMC/theme/com/sun/webui/jsf/suntheme4_1_1/javascript");</script><script type="text/javascript" src="/BMC/theme/com/sun/webui/jsf/suntheme4_1_1/javascript/webui-jsfx.js"></script><script type="text/javascript">webui.suntheme.bootstrap.init({"debug":false,"theme":{"locale":"en-US","prefix":"/BMC/theme","modulePath":"/com/sun/webui/jsf/suntheme4_1_1/javascript/theme","bundle":"suntheme","module":"webui.suntheme.theme"}});</script><link id="link1" rel="stylesheet" type="text/css" href="/BMC/resources/stylesheet.css" />I think the JK isapi_connector in IIS is preventing access to the META-INF path and the isapi_director log file says - "*+[emerg] HttpFilterProc::jk_isapi_plugin.c (1282): [BMC/theme/META-INF/json2_0/json.js] points to the web-inf or meta-inf directory. Somebody tries to hack into the site!!!+*". The same message is repeated for several more javascript files that are being served from under the META-INF path.
    Any help or advice in this matter will be greatly appreciated.
    Thanks!!!

    I managed to find a workaround. Thought i should share it with those who are faced with a similar issue.
    I found that a bug report had been placed in the past with Apache Dev. However, they had said that they would not modify their logic because the servlet container spec requires it (even though isapi_redirector is only a connector and not a container). They said that there is no way for the isapi_redirector to differentiate between /foo/WEB-INF when foo is a context and when foo is just a sub-directory of the ROOT web application. So, the general consensus was to err on the side of safety and risk blocking a few requests that are valid.
    However, this causes a serious issue for those using NetBeans JSF Visual Web Projects. Hence, I created my own flavour of isapi_redirector by modifying the code such that this check is not performed and leaving the onus of checking on Tomcat.
    For those who are interested, the simplest way to go about this would be to force the function uri_is_web_inf (in jk_isapi_plugin.c ) to always return FALSE.

  • How to make and start a session on Visual web JSF

    Hi;
    I am trying to make a Session on Visual Web JSF but cant get it, just get code to jsp, plz could u help me :)
    Thanks on advace
    Miguel Villalobos.

    Pondini wrote:
    Just why do you want to prevent TM from deleting old backups? If it's because you've been deleting things from your internal HD, trusting TM to keep it's copies indefinitely, that's not a good idea.
    The reason is, TM's copies are no longer backups: now they're your originals. When (not if) your TM drive fails, you may lose all of them.
    Thank you for your input. As I wrote earlier, I have reformatted the internal HD and reinstalled a "blank" system. So yes, most files, documents etc. are now found only in the TM backup. One reason for not simply doing a full restore from the TM backup was to allow time to make sure the internal HD was not in fact failing, and being able to reintroduce things step by step in case the problem should materialize again.
    The whole point of wanting to keep the existing TM backup as-is is to make it be there "indefinitely". That doesn't mean I trust the external HD to keep it safe for all eternity, but as long as I am trusting it to back up my stuff, why not let it keep my old stuff as well? Although, admittedly, it is space consuming and the important stuff will be present in both the old and the new backup, once I get it running. Old backup > iMac > New backup. You should see how many papers I have in my shelves from years back

  • Table display in Visual Web JSF (Project woodstock)

    Hi...
    I am trying to display a table(Quota) from a database in Visual Web JSF(project woodstock) and it works fine, as in I am able to run the project and a browser opens up dislaying the page with the date from the table. However when I try to display another table (Booking) from the same database, I am having problems. The page renders with no content(BLANK) in the browser. I am not sure why this is happening as I am using the same technique used to display content from the Quota table.
    This is my jsp code to display the Quota table ( this is the table that loads fine)
    <jsp:root version="2.1" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page"
    xmlns:webuijsf="http://www.sun.com/webui/webuijsf">
        <jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>
        <f:view>
            <webuijsf:page id="page1">
                <webuijsf:html id="html1">
                    <webuijsf:head id="head1">
                        <webuijsf:link id="link1" url="/resources/stylesheet.css"/>
                    </webuijsf:head>
                    <webuijsf:body id="body1" style="-rave-layout: grid">
                        <webuijsf:form id="form1">
                            <h:panelGrid id="gridPanel1" style="left: 216px; top: 216px; position: absolute">
                                <webuijsf:staticText id="staticText1" style="font-size: large" text="FACILITY"/>
                                <webuijsf:table augmentTitle="false" id="table1" title="Table" width="0">
                                    <webuijsf:tableRowGroup id="tableRowGroup1" rows="5" sourceData="#{SessionBean1.quotaArray}" sourceVar="currentRow">
                                        <webuijsf:tableColumn headerText="allocatedhours" id="tableColumn1" sort="allocatedhours">
                                            <webuijsf:staticText id="staticText2" text="#{currentRow.value['allocatedhours']}"/>
                                        </webuijsf:tableColumn>
                                        <webuijsf:tableColumn headerText="yearofStudy" id="tableColumn2" sort="yearofStudy">
                                            <webuijsf:staticText id="staticText3" text="#{currentRow.value['yearofStudy']}"/>
                                        </webuijsf:tableColumn>
                                    </webuijsf:tableRowGroup>
                                </webuijsf:table>
                            </h:panelGrid>
                        </webuijsf:form>
                    </webuijsf:body>
                </webuijsf:html>
            </webuijsf:page>
        </f:view>
    </jsp:root>Below is the jsp code to view the Booking table ( I am just getting a blank web page when I run the project with this code).
    <jsp:root version="2.1" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page"
    xmlns:webuijsf="http://www.sun.com/webui/webuijsf">
        <jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>
        <f:view>
            <webuijsf:page id="page1">
                <webuijsf:html id="html1">
                    <webuijsf:head id="head1">
                        <webuijsf:link id="link1" url="/resources/stylesheet.css"/>
                    </webuijsf:head>
                    <webuijsf:body id="body1" style="-rave-layout: grid">
                        <webuijsf:form id="form1">
                            <h:panelGrid id="gridPanel1" style="left: 216px; top: 216px; position: absolute">
                                <webuijsf:staticText id="staticText1" style="font-size: large" text="FACILITY"/>
                                <webuijsf:table augmentTitle="false" id="table1" title="Table" width="0">
                                    <webuijsf:tableRowGroup id="tableRowGroup1" rows="5" sourceData="#{SessionBean1.bookingArray}" sourceVar="currentRow">
                                        <webuijsf:tableColumn headerText="bookingdate" id="tableColumn1" sort="bookingdate">
                                            <webuijsf:staticText id="staticText2" text="#{currentRow.value['bookingdate']}"/>
                                        </webuijsf:tableColumn>
                                        <webuijsf:tableColumn headerText="bookingendtime" id="tableColumn2" sort="bookingendtime">
                                            <webuijsf:staticText id="staticText3" text="#{currentRow.value['bookingendtime']}"/>
                                        </webuijsf:tableColumn>
                                    </webuijsf:tableRowGroup>
                                </webuijsf:table>
                            </h:panelGrid>
                        </webuijsf:form>
                    </webuijsf:body>
                </webuijsf:html>
            </webuijsf:page>
        </f:view>
    </jsp:root>

    Hi..guys..
    The following is the code from my 'SessionBean1'.java file.
    package com.TestApp.managedbean;
    import com.TestApp.dao.QuotaFacadeLocal;
    import com.TestApp.entity.Quota;
    import com.TestApp.dao.BookingFacadeLocal;
    import com.TestApp.entity.Booking;
    import java.util.List;
    import javax.ejb.EJB;
    import com.sun.rave.web.ui.appbase.AbstractSessionBean;
    import javax.faces.FacesException;
    * <p>Session scope data bean for your application.  Create properties
    *  here to represent cached data that should be made available across
    *  multiple HTTP requests for an individual user.</p>
    * <p>An instance of this class will be created for you automatically,
    * the first time your application evaluates a value binding expression
    * or method binding expression that references a managed bean using
    * this class.</p>
    public class SessionBean1 extends AbstractSessionBean {
        // <editor-fold defaultstate="collapsed" desc="Managed Component Definition">
         * <p>Automatically managed component initialization.  <strong>WARNING:</strong>
         * This method is automatically generated, so any user-specified code inserted
         * here is subject to being replaced.</p>
        private void _init() throws Exception {
        // </editor-fold>
         * <p>Construct a new session data bean instance.</p>
        public SessionBean1() {
        @EJB
         private BookingFacadeLocal bookingDAO;
         private Booking[] bookingArray;
         @EJB
         private QuotaFacadeLocal quotaDAO;
         private Quota[] quotaArray;    
         * <p>This method is called when this bean is initially added to
         * session scope.  Typically, this occurs as a result of evaluating
         * a value binding or method binding expression, which utilizes the
         * managed bean facility to instantiate this bean and store it into
         * session scope.</p>
         * <p>You may customize this method to initialize and cache data values
         * or resources that are required for the lifetime of a particular
         * user session.</p>
        @Override
        public void init() {
            // Perform initializations inherited from our superclass
            super.init();
            // Perform application initialization that must complete
            // *before* managed components are initialized
            // TODO - add your own initialiation code here
            // <editor-fold defaultstate="collapsed" desc="Managed Component Initialization">
            // Initialize automatically managed components
            // *Note* - this logic should NOT be modified
            try {
                _init();
            } catch (Exception e) {
                log("SessionBean1 Initialization Failure", e);
                throw e instanceof FacesException ? (FacesException) e: new FacesException(e);
            // </editor-fold>
            // Perform application initialization that must complete
            // *after* managed components are initialized
            // TODO - add your own initialization code here
         * <p>This method is called when the session containing it is about to be
         * passivated.  Typically, this occurs in a distributed servlet container
         * when the session is about to be transferred to a different
         * container instance, after which the <code>activate()</code> method
         * will be called to indicate that the transfer is complete.</p>
         * <p>You may customize this method to release references to session data
         * or resources that can not be serialized with the session itself.</p>
        @Override
        public void passivate() {
         * <p>This method is called when the session containing it was
         * reactivated.</p>
         * <p>You may customize this method to reacquire references to session
         * data or resources that could not be serialized with the
         * session itself.</p>
        @Override
        public void activate() {
         * <p>This method is called when this bean is removed from
         * session scope.  Typically, this occurs as a result of
         * the session timing out or being terminated by the application.</p>
         * <p>You may customize this method to clean up resources allocated
         * during the execution of the <code>init()</code> method, or
         * at any later time during the lifetime of the application.</p>
        @Override
        public void destroy() {
         * <p>Return a reference to the scoped data bean.</p>
         * @return reference to the scoped data bean
        protected ApplicationBean1 getApplicationBean1() {
            return (ApplicationBean1) getBean("ApplicationBean1");
        public Booking[] getBookingArray() {
             List<Booking> bookingList = bookingDAO.findAll();
             if (bookingList != null) {
                 bookingArray = bookingList.toArray(new Booking[0]);
             } else {
                 bookingArray = null;
             return bookingArray;
        public Quota[] getQuotaArray() {
             List<Quota> quotaList = quotaDAO.findAll();
             if (quotaList != null) {
                 quotaArray = quotaList.toArray(new Quota[0]);
             } else {
                 quotaArray = null;
             return quotaArray;
    }

  • Query regarding Javascript in Visual Web JSF

    Hi,
    I am learning to use Visual web JSF using IDE Netbeans 6.5. I have a doubt regarding using Javascript in the .jsp file. Whenever I use document.getElementById("component-ID").value, I got an error as "component-ID has no properties". It returns null.
    Can any one tell me how to handle getElementId()? Or there are any other way to handle javascript in visual web JSF?
    Thanks.

    Thanks for the quick reply. I have seen the generated HTML. The component say 'txtPId' is referred as '_form1:txtPId'. So I have tried the following code:
        function setFocusOnFirst() {      
                       var xyz = document.getElementById('_form1:txtPId');
                       xyz.focus();
       <webuijsf:button binding="#{Page3.btnClick}" id="btnClick" style="height: 48px; left: 719px; top: 192px; position: absolute; width: 192px"   text="Click" onClick="setFocusOnFirst()"/>But it's not working. Should I do it in this way? Please guide.
    Thanks.

  • Method call before visual web jsf page loads

    Hi All.....
    I have written a method in a java class that accesses the mysql backend db to check if a process is still running. If the process is still running, a JOptionPane is produced informing the user of this and offers an <ok> option(to check the process status again) and a <cancel> option(to redirect the user to the homepage). If the process is completed, I want the page to just load as normal. I want this method to be called before the visual web jsf page loads. I have the method call in the super_init() method of the page and everything seemed to be working fine, the problem I have run into is that if I set the value in the db to show the process is running, the JOptionPane is produced(like it should be), and then if I set the value to show the process has completed and choose <ok> from the pane, the page loads.....this is what I want. Now, after the page loads, if I set the value in the db to show the process is running again, the JOptionPane is produced again right after I apply the changes to the db edit!!!!. I don't know why this is happening. Should I be calling the method from somewhere other the super_init()????? I have tried the method call in the prerender(), preprocess(), and destroy() methods all with the same results.
    Anyone have any ideas on what the problem could be??
    Thanks in advance.
    Silgd

    The Java part of a JSP/Servlet based webapplication runs physically at the server machine.
    Only the HTML/CSS/JS part which is generated by the webapplication and sent to the client physically runs at the client machine.
    JOptionPane is a Java Swing component which thus runs at the server machine. So you as client would only see it when both the server and the client runs at physically the same machine. Which is often only the case in development environment and doesn´t occur in real life! There is normally means of two physically different machines connected through the network/internet.
    To solve your actual problem, look for Ajax poll techniques. To display an alert or confirm dialogue in the client side, you use Javascript for this.

  • Could not get Using JPA Within a Visual Web JSF App Netbeans Tut.to work

    [http://testwww.netbeans.org/kb/60/web/web-jpa.html|http://testwww.netbeans.org/kb/60/web/web-jpa.html]
    Hi All,
    I am having difficulty displaying the content of Users table (Derby sample database) despite having followed all the steps provided in Using Java Persistence API Within a Visual Web JSF Application Netbeans Tutorial (http://testwww.netbeans.org/kb/60/web/web-jpa.html).
    It is uncleard from the instruction in step 3, section Creating a Java Persistence Entity Class Representing the Users Database Table - "The Entity Classes dialog dispalys. The IDE displays the database table name Users, and suggests a class name of Users. (Double click this class name to change it.)", but did not provide detail on what class name should it be changed to.
    I have tried building both TestModelApp (SE) and TestWebApp (Visual Web JSF) on JDK 1.6.13, Netbeans 6.5, Glassfish v2r2 and v3 (Prelude) on Windows XP platform without success.
    Any assistance would be greatly appreciated.
    Thanks,
    Jack

    Well, in real world the average professional Java EE / JSF developer doesn't use Netbeans nor Woodstock. Those are really for low-entry developers with zero technical knowledge who on its turn are often incapable of answering problems of your kind. Your question is also too non-technical and visualized and targeted on the wizards of Netbeans. After all your question is simply Netbeans specific, not JSF specific. If you try to ask it the more technical way (thus, at real source code level), you may have more chance on help.
    With regard to JPA specific issues, it unfortunately doesn't have a dedicated subforum yet here at forums.sun.com. You could try the [EJB forum|http://forums.sun.com/forum.jspa?forumID=13] or the [Java EE SDK|http://forums.sun.com/forum.jspa?forumID=136] forum.

  • How to use the feature of ajax in visual web jsf

    Hello,everyone!
    I want to use the feature of ajax in visual web jsf,but the program encountered a error. I want refresh the dropdownlist once the javascript captured the refresh message,they both behaved asynchronously. However, the textField1 rendered with a blank box,while the dropDown1 had no change. The code as follows:
    <jsp:root version="2.1" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:webuijsf="http://www.sun.com/webui/webuijsf">
    <jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>
    <f:view>
    <webuijsf:page binding="#{Page1.page1}" id="page1">
    <webuijsf:html binding="#{Page1.html1}" id="html1">
    <webuijsf:head binding="#{Page1.head1}" id="head1">
    <webuijsf:link binding="#{Page1.link1}" id="link1" url="/resources/stylesheet.css"/>
    <webuijsf:script>
    var processEvents = {                                                
    update: function(props) {
    var combo=document.getElementById("form1:dropDown1");
    combo.refresh();
    // Subscribe to refresh event.
    function refreshme(){
    var dom=document.getElementById("form1:textField1");
    dom.refresh();
    dojo.subscribe(webui.suntheme.widget.textField.event.refresh.endTopic, processEvents, "update");
    </webuijsf:script>
    </webuijsf:head>
    <webuijsf:body binding="#{Page1.body1}" id="body1" style="-rave-layout: grid">
    <webuijsf:form binding="#{Page1.form1}" id="form1">
    <webuijsf:textField binding="#{Page1.textField1}" id="textField1" onBlur="refreshme();"
    style="position: absolute; left: 168px; top: 144px" valueChangeListenerExpression="#{Page1.textField1_processValueChange}"/>
    <webuijsf:textField binding="#{Page1.textField2}" id="textField2" style="left: 168px; top: 96px; position: absolute"/>
    <webuijsf:dropDown binding="#{Page1.dropDown1}" id="dropDown1" items="#{Page1.dropDown1DefaultOptions.options}" style="position: absolute; left: 192px; top: 216px"/>
    </webuijsf:form>
    </webuijsf:body>
    </webuijsf:html>
    </webuijsf:page>
    </f:view>
    </jsp:root>
    /**********************************java******************************************/
    the function textField1_processValueChange didn't been invoked
    public void textField1_processValueChange(ValueChangeEvent event) {
    DropDown dd=getDropDown1();
    Option op1=new Option();
    String addText=(String)getTextField1().getText();
    op1.setLabel(addText);
    op1.setTooltip("tooptip");
    op1.setValue(addText);
    ArrayList <Option> l=null;
    Iterator <Option> i = dd.getListItems();
    while(i.hasNext()){
    l.add(i.next());
    l.add(op1);
    dd.setItems(l);
    thanks In advance all of your replies.

    Hi there,
    Take a look at this, will help you
    http://developers.sun.com/jscreator/learning/tutorials/2/textcompletion.html
    Thanks
    K

  • How to handle left-right navigation in visual web jsf?

    I am developing a new application using visual web jsf woodstock in netbeans and components. Tab works fine for top level navigation. Is there any solution for left-right navigation? I wanted tree but each node has a link to a very new page. How can i handle left right naviagtion the same way tab does, content loads on the same page.

    I don't know exactly how the tabs do it, but I suspect it is one of the following two methods. First method, all of the content of each tab is steamed in the original request and activating the tab controls just use JS/DHTML to hide some content and show the correct content. The second method would be to use AJAX style requests when the tab is activated to get the new content from the server and then JS/DHTML to show it.
    If you tree is large, you will not want to use the first method. If you use the second method, consider a JSF-aware AJAX library like a4j.
    On a side note, Woodstock is probably not the best choice for a new project, as it is no longer being actively developed (see [https://woodstock.dev.java.net/index.html|https://woodstock.dev.java.net/index.html]).

  • Using facelets and Visual web jsf frameworks together

    I am developing a new jsf application and I wanted to make the page navigation simpler like making the content pages independently using woodstock components and including them in the main template page.
    I have downloaded Facelets support plugin for netbeans and installed it. I have created a new project using the wizard and i specified the two (facelets and visual web jsf) as frameworks for use. But I failed to leverage my application with facelets because I don't know how to use woodstock components with facelets.
    I am new to jsf and i want the woodstock visual components. Can't I use facelets then?
    Plz help.

    I managed to find a workaround. Thought i should share it with those who are faced with a similar issue.
    I found that a bug report had been placed in the past with Apache Dev. However, they had said that they would not modify their logic because the servlet container spec requires it (even though isapi_redirector is only a connector and not a container). They said that there is no way for the isapi_redirector to differentiate between /foo/WEB-INF when foo is a context and when foo is just a sub-directory of the ROOT web application. So, the general consensus was to err on the side of safety and risk blocking a few requests that are valid.
    However, this causes a serious issue for those using NetBeans JSF Visual Web Projects. Hence, I created my own flavour of isapi_redirector by modifying the code such that this check is not performed and leaving the onus of checking on Tomcat.
    For those who are interested, the simplest way to go about this would be to force the function uri_is_web_inf (in jk_isapi_plugin.c ) to always return FALSE.

  • Visual Web JSF: Rendering a checkbox group with some checkboxes preselected

    Dear Sirs and Madams,
    I am a Visual Web JSF newbie and have been humbled by this one issue: I have User value objects which hold a List attribute of what user privileges they have. Am trying to render a checkbox group of user privileges for a chosen user with some user privileges already checked (the ones the user already has), and some not checked (potential privileges to give to the user) for the EditAUsersPrivileges page. Is this even possible? If so, how?
    Profusely thanking you in advance,
    Phoenix

    Of course, use the value attribute of the component and set it to EL representing the desired property.

  • NB Visual Web JSF Uses Transitional DOCTYPE, Need Strict for position:fixed

    When trying to create a CSS "position:fixed" element in my project that works for Firefox/IE6/IE7 I looked up the simple CSS hacks that need to be used for IE6. Unfortunately, IE6 MUST use a Strict DOCTYPE to accomplish this, and there appears to be no way to change this in the Visual Web projects.
    The only thing I can find is the webuijsf:page element has attributes that depending on their boolean value will toggle between a Transitional and Frameset DOCTYPE.
    Unless someone knows a CSS hack for IE6 that works with a Transitional DOCTYPE, is there a way for me to switch the Visual Web JSF stuff to use a Strict DOCTYPE?

    asherwin wrote:
    Unless someone knows a CSS hack for IE6 that works with a Transitional DOCTYPEGoogle gives lot results if I only search for "position:fixed".
    is there a way for me to switch the Visual Web JSF stuff to use a Strict DOCTYPE?If the documentation doesn't state anything about it, I would report this issue at the mailinglist/issuetracker at the homepage of Visual Web JSF.

  • About visual web jsf  tuotorials

    hi i am developing web application using visual web jsf frame work in netbeans iDE.can any one give me details about visual web jsf tutorials or books

    I don't use "visual JSF", but if I am correct, Netbeans has a lot of tutorials at their website.

Maybe you are looking for

  • How to call Function Module from webdynpro application ,up on click url in

    Hi Experts, I need your help for the following scenario. In my WebDynpro application , I am displaying the sales orders in a table. one of the column in table  i.e. sales order number is displayed with hyper link, up on click the sales order number c

  • Run Form problem

    Hi, I am new to Forms. Just installed 10g Developer Suit, and created a simple form and when tried to Run it, it starts but bounces out immediately, logging these lines in the OC4J Listener screen: 08/04/18 21:27:01 FormsServlet init(): configFileNam

  • S/PDIF-In on XtremeGamer, with Vista. Confusion abo

    Let me make this short. Vista x32. X-Fi XtremeGamer with the newest drivers. Xbox 360. S/PDIF-In. No Workie. I have some logitech 5. speakers with the three colored plugs, those are plugged into the card, 5. works fine. I would like to have digital s

  • Code completion and formatting

    Hi, The code completion works only for the objects not for keywords. Also for the case seems to be fixed during code completion? It would be nice to have code completion for both keywords and objects with case configuration. It would save a lot of ti

  • HH3 Gateway Address Problem

    Hi, I have just had Infinity installed and have an issue with the BT homehub3.   The hub has an IP 192.168.1.254 however when it assigns an IP address to either my desktop or laptop using DHCP  it assigns the gateway address as 192.168.1.1 and conseq