當前位置: 首頁>>代碼示例>>Java>>正文


Java JspWriter.println方法代碼示例

本文整理匯總了Java中javax.servlet.jsp.JspWriter.println方法的典型用法代碼示例。如果您正苦於以下問題:Java JspWriter.println方法的具體用法?Java JspWriter.println怎麽用?Java JspWriter.println使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.servlet.jsp.JspWriter的用法示例。


在下文中一共展示了JspWriter.println方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: doEndTag

import javax.servlet.jsp.JspWriter; //導入方法依賴的package包/類
/**
 * Does two things:
 * <ul>
 *      <li>Stops the page if the corresponding attribute has been set</li>
 *      <li>Prints a message another tag encloses this one.</li>
 * </ul>
 */
public int doEndTag() throws JspTagException
{
    //get the parent if any
    Tag parent = this.getParent();

    if (parent != null) {
        try {
            JspWriter out = this.pageContext.getOut();
            out.println("This tag has a parent. <BR>");

        } catch (IOException e) {
            throw new JspTagException(e.getMessage());
        }
    }

    if (this.stopPage) {

        return Tag.SKIP_PAGE;
    }

    return Tag.EVAL_PAGE;
}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:30,代碼來源:SampleTag.java

示例2: otherDoEndTagOperations

import javax.servlet.jsp.JspWriter; //導入方法依賴的package包/類
/** The HTML is generated in this end tag, assuming the underlying field
 *  is not read-only or hidden
 */
public void otherDoEndTagOperations() throws JspException {
    
    super.otherDoEndTagOperations();
    
    if (getPropertyRuleIntrospector() == null ||
            (getPropertyRuleIntrospector() != null && !getPropertyRuleIntrospector().isHidden() && !getPropertyRuleIntrospector().isReadOnly() ) ) {
        
        try {
            JspWriter out = pageContext.getOut();
            out.println( getHtml() );
        } catch (IOException e) {
            String str = "Exception in writing the " + TAG_NAME;
            log.error(str, e);
            throw new JspWriteRuntimeException(str, e);
        }
    } else {
        log.debug(TAG_NAME + " Not displayed as field " + getField() + " is hidden or read-only");
    }
    
}
 
開發者ID:jaffa-projects,項目名稱:jaffa-framework,代碼行數:24,代碼來源:CalendarTag.java

示例3: writeTagBodyContent

import javax.servlet.jsp.JspWriter; //導入方法依賴的package包/類
/** This generates the HTML for the tag.
 * @param out The JspWriter object.
 * @param bodyContent The BodyContent object.
 * @throws IOException if any I/O error occurs.
 */
public void writeTagBodyContent(JspWriter out, BodyContent bodyContent) throws IOException {

    if (isFirstPass())
        // Write the main table tag, the table column headings, and start the table body
        out.println( getInitialHtml() );

    // Write out the start and end of the rows.
    out.println( getRowStartHtml() );
    if (m_hasRows)
        out.println( processRow());
    out.println( getRowEndingHtml() );

    // clear the body content for the next time through.
    bodyContent.clearBody();

    // Increment the RowNo
    ++m_rowNo;

    //Reset the column counters
    m_currColumnNo = 0;
    m_currColName = null;
}
 
開發者ID:jaffa-projects,項目名稱:jaffa-framework,代碼行數:28,代碼來源:GridTag.java

示例4: doTag

import javax.servlet.jsp.JspWriter; //導入方法依賴的package包/類
public void doTag() throws JspException, IOException {
JspWriter out = getJspContext().getOut();
for( int i = 0; i < keys.size(); i++ ) {
    String key = (String)keys.get( i );
    Object value = values.get( i );
    out.println( "<li>" + key + " = " + value + "</li>" );
       }
   }
 
開發者ID:liaokailin,項目名稱:tomcat7,代碼行數:9,代碼來源:EchoAttributesTag.java

示例5: doEndTag

import javax.servlet.jsp.JspWriter; //導入方法依賴的package包/類
@Override
public int doEndTag() throws JspException {

	JspWriter out = pageContext.getOut();

	try {
		out.println(fckEditor);
	} catch (IOException e) {
		throw new JspException(
				"Tag response could not be written to the user!", e);
	}

	return EVAL_PAGE;
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:15,代碼來源:EditorTag.java

示例6: writeString

import javax.servlet.jsp.JspWriter; //導入方法依賴的package包/類
private void writeString(String output) {
try {
    JspWriter writer = pageContext.getOut();
    writer.println(output);
} catch (IOException e) {
    log.error("HTML tag unable to write out HTML details due to IOException.", e);
    // don't throw a JSPException as we want the system to still function, well, best
    // the page can without the html tag!
}
   }
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:11,代碼來源:HtmlTag.java

示例7: doStartTag

import javax.servlet.jsp.JspWriter; //導入方法依賴的package包/類
@Override
   public int doStartTag() throws JspException {

String serverURL = Configuration.get(ConfigurationKeys.SERVER_URL);
serverURL = serverURL == null ? null : serverURL.trim();

if (serverURL != null) {
    try {
	HttpSession session = ((HttpServletRequest) this.pageContext.getRequest()).getSession();
	String pageDirection = (String) session.getAttribute(LocaleFilter.DIRECTION); // RTL or LTR (default)
	boolean rtl = CssTag.RTL_DIR.equalsIgnoreCase(pageDirection);

	List<String> themeList = CSSThemeUtil.getAllUserThemes();
	String customStylesheetLink = null;
	for (String theme : themeList) {
	    if (theme != null) {
		theme = appendStyle(theme, rtl);
		customStylesheetLink = generateLink(theme, serverURL);
	    }

	    if (customStylesheetLink != null) {
		JspWriter writer = pageContext.getOut();
		writer.println(customStylesheetLink);
	    }
	}

    } catch (IOException e) {
	CssTag.log.error("CssTag unable to write out CSS details due to IOException.", e);
	// don't throw a JSPException as we want the system to still function.
    }
} else {
    CssTag.log.warn(
	    "CSSTag unable to write out CSS entries as the server url is missing from the configuration file.");
}

return Tag.SKIP_BODY;
   }
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:38,代碼來源:CssTag.java

示例8: doStartTag

import javax.servlet.jsp.JspWriter; //導入方法依賴的package包/類
/**
 * Prints the names and values of everything in page scope to the response,
 * along with the body (if showBody is set to <code>true</code>).
 */
public int doStartTag() throws JspTagException
{
    Enumeration names =
        pageContext.getAttributeNamesInScope(PageContext.PAGE_SCOPE);

    JspWriter out = pageContext.getOut();

    try {

        out.println("The following attributes exist in page scope: <BR>");

        while (names.hasMoreElements()) {
            String name = (String) names.nextElement();
            Object attribute = pageContext.getAttribute(name);

            out.println(name + " = " + attribute + " <BR>");
        }

        if (this.showBody) {

            out.println("Body Content Follows: <BR>");
            return EVAL_BODY_INCLUDE;
        }

    } catch (IOException e) {
        throw new JspTagException(e.getMessage());
    }

    return SKIP_BODY;
}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:35,代碼來源:SampleTag.java

示例9: doEndTag

import javax.servlet.jsp.JspWriter; //導入方法依賴的package包/類
@Override
public int doEndTag() throws JspException {
    if ((jspFile.indexOf( ".." ) >= 0) ||
        (jspFile.toUpperCase(Locale.ENGLISH).indexOf("/WEB-INF/") != 0) ||
        (jspFile.toUpperCase(Locale.ENGLISH).indexOf("/META-INF/") != 0))
        throw new JspTagException("Invalid JSP file " + jspFile);

    InputStream in = pageContext.getServletContext().getResourceAsStream(
            jspFile);
    if (in == null)
        throw new JspTagException("Unable to find JSP file: " + jspFile);

    try {
        JspWriter out = pageContext.getOut();
        out.println("<body>");
        out.println("<pre>");
        for (int ch = in.read(); ch != -1; ch = in.read())
            if (ch == '<')
                out.print("&lt;");
            else
                out.print((char) ch);
        out.println("</pre>");
        out.println("</body>");
    } catch (IOException ex) {
        throw new JspTagException("IOException: " + ex.toString());
    } finally {
        try {
            in.close();
        } catch (IOException e) {
            throw new JspTagException("Can't close inputstream: ", e);
        }
    }
    return super.doEndTag();
}
 
開發者ID:sunmingshuai,項目名稱:apache-tomcat-7.0.73-with-comment,代碼行數:35,代碼來源:ShowSource.java

示例10: doTag

import javax.servlet.jsp.JspWriter; //導入方法依賴的package包/類
@Override
public void doTag() throws JspException, IOException {
    JspWriter out = getJspContext().getOut();
    for( int i = 0; i < keys.size(); i++ ) {
        String key = keys.get( i );
        Object value = values.get( i );
        out.println( "<li>" + key + " = " + value + "</li>" );
    }
}
 
開發者ID:sunmingshuai,項目名稱:apache-tomcat-7.0.73-with-comment,代碼行數:10,代碼來源:EchoAttributesTag.java

示例11: doEndTagExt1

import javax.servlet.jsp.JspWriter; //導入方法依賴的package包/類
/** This method will write out the hidden-fields */
private void doEndTagExt1(JspWriter writer) throws IOException {
    Object formObj = pageContext.findAttribute(getBeanName());
    if(formObj != null && formObj instanceof FormBase) {
        FormBase f = (FormBase) formObj;
        StringBuffer buf = new StringBuffer();
        buf.append("<input type='hidden' name='" + PARAMETER_COMPONENT_ID + "' value='" + (f.getComponent()==null ? "" : f.getComponent().getComponentId() ) + "'>\n");
        buf.append("<input type='hidden' name='" + PARAMETER_EVENT_ID + "' value=''>\n");
        buf.append("<input type='hidden' id='" + PARAMETER_DATESTAMP_ID + "' value='" + m_dateTime.timeInMillis() + "'>\n");
        //            buf.append("<input type=\"hidden\" name=\"" + PARAMETER_TOKEN_ID + "\" value=\"" +
        //            (UserSession.getUserSession((HttpServletRequest) pageContext.getRequest()).getCurrentToken()) + "\">\n");
        buf.append("</span>");
        writer.println(buf.toString());
    }
}
 
開發者ID:jaffa-projects,項目名稱:jaffa-framework,代碼行數:16,代碼來源:FormTag.java

示例12: doEndTagExt2

import javax.servlet.jsp.JspWriter; //導入方法依賴的package包/類
/** This method will write out all the header-info for the widgets in the form */
private void doEndTagExt2(JspWriter writer) throws IOException {
    // Display guarded page section
    writer.println(determineGuardedHtml());
    // Write out and footer code needed by the widgets
    for (Iterator iter=m_footerCache.keySet().iterator(); iter.hasNext(); ) {
        Object key = iter.next();
        Object javaScript = m_footerCache.get(key);
        if(javaScript!=null) {
          writer.println(javaScript);
          if(log.isDebugEnabled())
              log.debug("Write Footer Code For Widget " + key + "\n" + javaScript);
        }
    }
}
 
開發者ID:jaffa-projects,項目名稱:jaffa-framework,代碼行數:16,代碼來源:FormTag.java

示例13: otherDoStartTagOperations

import javax.servlet.jsp.JspWriter; //導入方法依賴的package包/類
/** Called from the doStartTag()
 */
public void otherDoStartTagOperations() throws JspException {

    super.otherDoStartTagOperations();

    JspWriter writer = pageContext.getOut();
    StringBuffer buf = new StringBuffer();
    Boolean bool = null;

    buf.append("<SCRIPT type=\"text/javascript\" src=\"jaffa/js/panels/footer.js\"></SCRIPT>\n");

    // Generate the html for the error-popup if required
    bool = (Boolean) pageContext.findAttribute(TagHelper.ATTRIBUTE_ERROR_BOX_IN_SAME_WINDOW);
    if (bool != null && bool.booleanValue() )
        buf.append( getErrorBoxHtml() );

    // Generate the html for the keyboard if required
    bool = (Boolean) pageContext.findAttribute(TagHelper.ATTRIBUTE_KEYBOARD_IN_USE);
    if (bool != null && bool.booleanValue() )
        buf.append( getKeyboardHtml() );

    // Generate the html for the keypad if required
    bool = (Boolean) pageContext.findAttribute(TagHelper.ATTRIBUTE_KEYPAD_IN_USE);
    if (bool != null && bool.booleanValue() )
        buf.append( getKeyboardHtml() );

    try {
        writer.println(buf.toString());
    } catch (IOException e) {
        String str = "Exception in writing the FooterTag";
        log.error(str, e);
        throw new JspWriteRuntimeException(str, e);
    }

}
 
開發者ID:jaffa-projects,項目名稱:jaffa-framework,代碼行數:37,代碼來源:FooterTag.java

示例14: otherDoEndTagOperations

import javax.servlet.jsp.JspWriter; //導入方法依賴的package包/類
/** Concludes the html for the grid tag.
 * Called from the doEndTag()
 */
public void otherDoEndTagOperations() throws JspException {
    super.otherDoEndTagOperations();
    try {
        JspWriter out = pageContext.getOut();
        out.println( getEndingHtml() );
        if (OUTPUT_TYPE_WEB_PAGE.equals(m_outputType) && isUserGrid() )
            out.println( writeSettingsTable() );
    } catch (IOException e) {
        String str = "Exception in writing the " + TAG_NAME;
        log.error(str, e);
        throw new JspWriteRuntimeException(str, e);
    }

}
 
開發者ID:jaffa-projects,項目名稱:jaffa-framework,代碼行數:18,代碼來源:GridTag.java

示例15: htmlConfigTablesForInstructionalOffering

import javax.servlet.jsp.JspWriter; //導入方法依賴的package包/類
public void htmlConfigTablesForInstructionalOffering(
 		SessionContext context,
 		ClassAssignmentProxy classAssignment, 
 		ExamAssignmentProxy examAssignment,
         Long instructionalOffering, 
         JspWriter outputStream,
         String backType,
         String backId){
 	
 	setBackType(backType);
     setBackId(backId);    	
 	
     if (CommonValues.Yes.eq(context.getUser().getProperty(UserProperty.ClassesKeepSort))) {
 		setClassComparator(
 			new ClassCourseComparator(
 					context.getUser().getProperty("InstructionalOfferingList.sortBy",ClassCourseComparator.getName(ClassCourseComparator.SortBy.NAME)),
 					classAssignment,
 					false
 			)
 		);
 	}
 	
    	if (instructionalOffering != null) {
      InstructionalOfferingDAO iDao = new InstructionalOfferingDAO();
      InstructionalOffering io = iDao.get(instructionalOffering);
      
setUserSettings(context.getUser());

Vector subpartIds = new Vector();

if (io.getInstrOfferingConfigs() != null){
      	TreeSet configs = new TreeSet(new InstrOfferingConfigComparator(io.getControllingCourseOffering().getSubjectArea().getUniqueId()));
      	configs.addAll(io.getInstrOfferingConfigs());
      	InstrOfferingConfig ioc = null;
      	int idx = 0;
      	for(Iterator it = configs.iterator(); it.hasNext();idx++){
      		ioc = (InstrOfferingConfig) it.next();
      		if (idx>0 && getDisplayConfigOpButtons()) {
      			try {
      				outputStream.println("<br>");
      			} catch (IOException e) {}
      		}
      		this.htmlTableForInstructionalOfferingConfig(subpartIds, classAssignment, examAssignment, ioc, context, outputStream);
      	}
      }

Navigation.set(context, Navigation.sSchedulingSubpartLevel, subpartIds);
    	}
 }
 
開發者ID:Jenner4S,項目名稱:unitimes,代碼行數:50,代碼來源:WebInstrOfferingConfigTableBuilder.java


注:本文中的javax.servlet.jsp.JspWriter.println方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。