当前位置: 首页>>代码示例>>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;未经允许,请勿转载。