草庐IT

context-param

全部标签

PHP session_set_cookie_params() 问题

对于我登录部分的每个页面的标题,我添加了以下代码来维护session:session_set_cookie_params(1200,'/mysystem');session_start();我的意图是,我通过函数session_set_cookie_params()将session生命周期设置为1200秒,路径为/mysystem.使用此函数的原因是将sessioncookie与同一域中的其他PHP脚本分开,例如http://www.example.com/another_system/问题是,session在达到1200秒时过期,无论是否有事件(例如在/mysystem下加载另一个页

php - ( fatal error : Call to a member function bind_param() on a non-object)

这个问题在这里已经有了答案:Whattodowithmysqliproblems?Errorslikemysqli_fetch_array():Argument#1mustbeoftypemysqli_resultandsuch(1个回答)关闭4个月前。我收到此文本的错误:(抱歉我的英语不好,我来自德国!)错误:fatalerror:在第44行/users/ftf/www/ccache.php中的非对象上调用成员函数bind_param()部分代码来自ccache.php//NeuesDatenbank-Objekterzeugen$db=@newmysqli('localhost',

PHP - 如何解决错误 "using $this when not in object context"?

我有这个特质类:traitExample{protected$var;privatestaticfunctionprintSomething(){print$var;}privatestaticfunctiondoSomething(){//dosomethingwith$var}}这个类:classNormalClass{useExample;publicfunctionotherFunction(){$this->setVar($string);}publicfunctionsetVar($string){$this->var=$string;}}但是我收到了这个错误:fatale

php - 在非对象上调用成员函数 bind_param()(尽管研究无法解决)

这个问题在这里已经有了答案:Whattodowithmysqliproblems?Errorslikemysqli_fetch_array():Argument#1mustbeoftypemysqli_resultandsuch(1个回答)关闭去年。$stmt=$mysqli->prepare('selectUnfrommemberwhereLock=?andActivated=?');$stmt->bind_param("ss",'N','Y');//Thislinegavetheerror$stmt->execute();$stmt->store_result();//applyt

php - PDO PARAM_STR 和长度

我不明白PDOPARAM_*语句中的长度选项。长度是否表示所需字符的数量,还是最大值?例子:$sth->bindParam(2,$color,PDO::PARAM_STR,12);这需要12个字符,还是限制为12个字符?或者,我是否完全误解了这是在做什么? 最佳答案 它表示您希望在输出参数中接收多少数据,服务器不会发送超过此数量的数据。因此,要回答您的问题,这是一个限制而非要求。 关于php-PDOPARAM_STR和长度,我们在StackOverflow上找到一个类似的问题:

php - 带有 IN(?) 的 mySQL bind_param

这个问题在这里已经有了答案:Howtobindanarrayofstringswithmysqlipreparedstatement?(6个答案)关闭去年。在所有查询中使用bind_param,我现在想使用IN(?),其中列表中的元素数量可以变化。我在这里使用的SQLout函数基本上执行$sql_db->prepare、->bind_param、->execute(),->store_result(),->bind_result//thecodebelowdoesnotworkasthequeryonlymatchesonelement'a':$locations=('a','b','

java - ClassNotFoundException : org. springframework.web.context.ContextLoaderListener 问题

我在我的项目中遇到了一些问题,这是一个SpringMVC项目。在这个项目中,对于持久层,我们使用Hibernate。下面是我的web.xml详细信息:springorg.springframework.web.servlet.DispatcherServlet1spring/contextConfigLocation/WEB-INF/beanRefFactory.xmlorg.springframework.web.context.ContextLoaderListener当我尝试运行这个项目时,出现以下错误:java.lang.ClassNotFoundException:org.s

java - 了解 REST API——什么是 Context 和 @Context?

我最近学习了restfulweb服务教程,但无法理解什么是context。有人可以解释它是什么以及@Context的作用吗? 最佳答案 JAX-RS提供了@Context注解来注入(inject)12个与HTTP请求上下文相关的对象实例,它们是:SecurityContext-当前HTTP请求的安全上下文实例Request-用于设置前置条件请求处理应用程序、配置和提供程序->提供对JAX-RS应用程序、配置和提供程序实例的访问权限ResourceContext-资源关联类实例ServletConfig-ServletConfig实例

java - 了解 tomcat 6 中的 context.xml

我在eclipse中创建了一个主要是空的动态web项目。有没有servlet没有jsp文件web.xml是testprojektindex.htmlindex.htmindex.jspdefault.htmldefault.htmdefault.jsp然后我在它的META-INF文件夹中添加了一个context.xml我将这个项目导出为WAR文件。具有以下结构:user@system:$tree.|--META-INF||--MANIFEST.MF|`--context.xml`--WEB-INF|--classes|--lib`--web.xml4directories,3files

java - Spring:如何替换在Application Context中创建的Environment bean

我希望用我自己的实现替换Spring使用的环境bean。这是不好的做法吗?如果不是,我怎样才能干净地做到这一点?目前我已经创建了一个实现Environment接口(interface)并使用现有Environmentbean的bean,但这意味着所有需要Environmentbean的配置代码现在都必须使用我的自定义Environmentbean。我认为用我自己的替换SpringsEnvironmentbean会更干净,然后不需要更改需要它的配置。目前我能想到的唯一方法是创建我自己的ApplicationContext从而将环境设置为我自己的,或者让某些东西成为ApplicationC