我有一个问题.在我的网络应用程序中,我有一个页面,启动另一个线程,耗时的任务.在这个新线程中,我调用了一个我的架构方法(在另一个项目中 - 一个架构项目).问题是:在其中一种方法中,我访问了一个HttpContext.Current.Session字段.但是当我启动应用程序时,会抛出一个异常,说该对象(HttpContext.Current.Session)有一个空引用.我怎么能设置新线程的上下文与HttpApplication上下文相同才能访问HttpContext.Current.Session?
我分别通过npm install -g cordova和npm install -g phonegap安装了cordova e phonegap .然后我通过cordova创建了一个HelloWorld应用程序,创建了HelloWorld mynamespace.helloworld HelloWorld.它工作正常!然后我将我的工作目录更改为HelloWorld,我尝试通过cordova平台添加android -d为Android构建应用程序,但它无法正常工作.这是输出:
Installing cordova library for android...
Requesting {"uri":"https://git-wip-us.apache.org/repos/asf?p=cordova-android.git;a=snapshot;h=3.3.0;sf=tgz"}...
Downloading cordova library for android...
Downloaded, unzipped and extracted 541065 byte response.
Download complete
Installing cordova library for android...
Checking if platform "android" passes minimum requirements...
Creating android project...
Running bin/create for platform "android" with command: ""C:\Users\marcos.pacheco\.cordova\lib\android\cordova\3.3.0\bin\create" "C:\Dev\HelloWorld\platforms\android" "mynamespace.helloworld" "HelloWorld"" (output to follow)
C:\Users\marcos.pacheco\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:126
throw e;
^
Error: An error …
Run Code Online (Sandbox Code Playgroud) 我有一个自定义的Xsl文件用于我的XsltListViewWebPart,但是当我运行带有Web部件的页面时,我在我的日志中得到以下异常:
Error while executing web part: System.Xml.Xsl.XslTransformException: Cannot find a script or an extension object associated with namespace 'http://schemas.microsoft.com/WebParts/v3/Publishing/runtime'. at System.Xml.Xsl.Runtime.XmlQueryContext.InvokeXsltLateBoundFunction(String name, String namespaceUri, IList`1[] args) at <xsl:template name="OuterTemplate.GetSafeStaticUrl">(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current, String UrlColumnName) at <xsl:template match="Row">(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current) at <xsl:template match="dsQueryResponse">(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime... 1fbf809c-8c95-d00a-8f55-21bd43c1d0d2
89a1 High ..., XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current) at <xsl:apply-templates>(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator ) at Root(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime) at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer) at Microsoft.SharePoint.WebPartPages.DataFormWebPart.ApplyXslTransform(XPathNavigator dataNavigator, XslCompiledTransform xslCompiledTransform, XsltArgumentList xmlArguments) at Microsoft.SharePoint.WebPartPages.DataFormWebPart.ExecuteTransform(XslCompiledTransform xslCompiledTransform, XsltArgumentList …
Run Code Online (Sandbox Code Playgroud) 我在这里遇到了麻烦.我有一个JSF应用程序,它有一个名为baseTemplate.xhtml的模板文件.该文件位于/ resources/template文件夹中.遵循文件代码:
<?xml version='1.0' encoding='UTF-8' ?>
<!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:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
<h:head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<h:outputStylesheet library="css" name="default.css"/>
<h:outputStylesheet library="css" name="cssLayout.css"/>
<h:outputStylesheet library="css" name="menu.css"/>
<h:outputStylesheet library="css" name="rodape.css"/>
<title>JSF Project</title>
</h:head>
<h:body>
<div id="estrutura">
<div class="top">
<ui:insert name="top">
<ui:include src="somefile"/>
</ui:insert>
</div>
<div id="menu">
<ui:insert name="menu">
<ui:include src="somefile"/>
</ui:insert>
</div>
<div>
<div id="left">
<ui:insert name="left">
</ui:insert>
</div>
<div id="content" class="left_content">
<ui:insert name="content"></ui:insert>
</div>
</div>
<div id="bottom">
<ui:insert name="bottom">
<ui:include …
Run Code Online (Sandbox Code Playgroud) 我在这里遇到麻烦了。在我看来,我有以下代码:
@if (!string.IsNullOrEmpty(alert)) {
<div class="alert">@Html.Raw(alert)</div>
}
Run Code Online (Sandbox Code Playgroud)
但是抛出了一个类型NullReferenceException
异常,说Html属性为null。我该如何解决?
OBS:我的视图页面继承自一个类,而该类又继承自 System.Web.WebPages.WebPage
// WEBCONFIG
<system.web>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Web.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Web.WebPages.Deployment, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</assemblies>
</compilation>
<httpRuntime targetFramework="4.0"/>
Run Code Online (Sandbox Code Playgroud)
我有以下问题:在详细信息部分的主报告中,我有三个子报告.我将它们的" 位置类型 " 设置为" 浮动"和" 拉伸"类型为" 相对于波段高度"但结果不是预期的.该报告长达500页,只打印了第一个子报告的内容.可能有什么问题?
<?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="Relatorio_Ivan_Master" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20">
<property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="96"/>
<parameter name="ID_FUNCIONARIO" class="java.lang.Integer">
<defaultValueExpression><![CDATA[1]]></defaultValueExpression>
</parameter>
<parameter name="DTA_INICIO" class="java.util.Date"/>
<parameter name="DTA_TERMINO" class="java.util.Date"/>
<parameter name="SUBREPORT_DIR" class="java.lang.String" isForPrompting="false">
<defaultValueExpression><![CDATA["/Users/marcosnatanpacheco/Desktop/"]]></defaultValueExpression>
</parameter>
<queryString>
<![CDATA[SELECT idt_funcionario, nme_funcionario, dta_alocacao_local, dta_alocacao_recurso, dta_alocacao_servico FROM tb_funcionario AS t1
INNER JOIN ta_alocacao_local AS t2 ON t2.cod_funcionario = t1.idt_funcionario
INNER JOIN ta_alocacao_recurso AS t3 ON t3.cod_funcionario …
Run Code Online (Sandbox Code Playgroud)