English 中文(简体)
Servelet 请求和窗口. place.href
原标题:Servlet requests and window.location.href

我有一个 java servlet, 设置请求属性, 用于特定页面。 在该页面上, 有一些 java scription 可以重定向到有窗口的新的页面. place.href=...

请求属性是否会在被调整的页面中提供?我知道这个问题有点混乱,我对此表示歉意,我不太确定如何更好地解释,但我事先感谢你的耐心!

最佳回答

将会为重定向创建一个新请求, 您将会失去您的请求范围属性。 如果您想要保留数据, 请考虑在会话中将其存储 。

问题回答

请求的属性仅用于设定属性的请求的期间/范围。您应该使用会话范围属性。

每次您重定向到新页面时,它就是一个全新的请求,并且创建一个新的请求对象。因此,您在先前请求对象中拥有的任何对象都将被丢弃。尝试在会话或应用范围中保存您的数据。这应该解决它。





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签