每个常见问题解答(FAQ)都应该从指南中的相关页面进行交叉引用。这意味着在创建FAQ时,应该确保它与指南中的某个具体部分或页面相关联,这样用户在阅读指南时如果遇到问题或需要更多信息,就可以直接通过这些链接找到相关的FAQ。
交叉引用有助于提高信息的可访问性和用户体验,因为它允许用户快速跳转到他们需要的信息,而不需要离开当前页面或进行复杂的搜索。此外,它还有助于保持信息的一致性和准确性,因为FAQ的内容可以直接与指南中的具体信息相对应。
有效地在网站或文档中实现交叉引用,可以通过以下几种方法来实现:
-
使用锚点链接:在需要引用的内容前后添加锚点标记,例如
<a id="section1"></a>
,然后在需要引用的地方使用<a href="#section1">跳转到Section 1</a>
。这样用户点击链接时可以直接跳转到指定的内容部分。 -
利用目录结构:对于长文档,可以创建一个目录,列出所有章节和子章节的链接。这不仅有助于读者快速导航,也方便了内容的交叉引用。
-
使用脚注或尾注:对于学术文档或研究报告,可以在页面底部或文档末尾添加脚注或尾注,对文中提及的信息进行详细说明,并提供相关引用。
-
内联代码注释:如果是技术文档或教程,可以使用内联代码注释来引用相关的代码段或API文档。
-
动态内容加载:对于网页,可以使用JavaScript等技术动态加载相关内容,当用户滚动到特定部分时才显示详细信息或引用的内容。
-
使用专业的文档工具:如Microsoft Word、LaTeX等,它们提供了强大的交叉引用功能,可以自动更新引用编号和链接。
-
保持一致性:确保整个文档中的引用格式一致,无论是链接颜色、字体样式还是提示信息,都应该遵循统一的标准。
-
测试和验证:在发布之前,彻底测试所有的交叉引用是否有效,确保没有死链或错误的引用。
-
考虑用户体验:设计易于理解和使用的界面元素,如清晰的按钮、直观的图标和简洁的文本描述,以提高用户的交互体验。
-
遵守版权和隐私政策:如果引用的内容受版权保护或有隐私要求,请确保获得适当的授权,并遵守相关法律法规。
Each FAQ should be cross-referenced from a relevant page in one of the guides. (If a relevant page in the guide is missing, then we probably need to create one!) Each question should be a new page. Answers should be concise and focused. If an answer seems long, or seems like it could relate to more than one section, then the question might be addressing more than one concern.
FAQs can also be “mini-HOWTOs”. As long as the question and answer are focused on a single concern, length is not an issue.
Migrating
See the Migration Guide
General
Where do we get the latest version the framework?
What are some of the framework's best features?
What are the fundamental differences between Struts and JSF?
Can you suggest an elevator pitch?
HOWTO
How can we display dynamic or static images that can be provided as an array of bytes?
How can we return a text string as the response?
How can we test applications?
How can we test Actions?
How do we upload files?
How do we download files within the framework?
How can we force the Action Mappings (struts.xml) to reload?
How can I test my action output, validation or the action execution outside a container?
Configuration
Can we break up a large struts.xml file into smaller pieces?
Parameters in configuration results
Make Struts throw exceptions on missing properties, or log them
Accessing Resources
How do we get access to the session?
How do we get invalidate the session?
How can we access the HttpServletRequest?
How can we access the HttpServletResponse?
How can we access request parameters passed into an Action?
How do we access static parameters from an Action?
Can we access an Action's Result?
How do I obtain security details (JAAS)?
How do we access the Action Invocation, action name or namespace from a view?
Per-Page Settings
Can I change theme on a per-page basis?
Can I change templateDir on a per-page basis?
Can I change templateSuffix on a per-page basis?
Interceptors
Why isn't our Prepare interceptor being executed?
Why does my setter not get called by the Params interceptor?
How do we configure an Interceptor to be used with every Action?
Validation
Why is my action returning "input" when the form is filled out correctly?
How do I use messages from within the validator?
How can I fix the "Attribute 'short-circuit'" error message?
How do we repopulate controls when validation fails?
How do I unit test my action's validation logic?
Why does WW ignore my message when its enclosed in CDATA?
Localization
How do we change locales?
How do I set a global resource bundle?
How do I decouple XWork LocalizedTextUtil global resource bundle loading from serlvets?
How do I add I18N to a UI tag, like the textfield tag?
Can I add I18N outside the Action's context?
How to support UTF-8 URIEncoding with Tomcat?
How do I enable encoding in my forms?
How to escape special chars in resource bundles?
Type Conversion
How do I change the invalid input error message for a particular field?
Why is the application logging a warning that the Compound Root cannot find a particular Object with a particular property?
Value Stack
What are the default variables in the value stack?
Tags
Why do the form tags put table tags around controls?
How can I put a String literal in a Javascript call, for instance in an onChange attribute?
Why won't the 'if' tag evaluate a one char string?
Why does FreeMarker complain that there's an error in my user-directive when I used JSP Tag?
Can an action tag run another method apart from the default execute method?
Why didn't my action tag get executed when I have validation errors?
Why are request parameters appended to our hyperlinks?
Why doesn't the if tag evaluate test="#parameters.someParam ... " properly
How do I render a single radio button?
Why do I get a javax.el.ELException when using OGNL with JSP2.1?
Why can't I use JSTL-style EL expressions in Struts tags?
How can I iterate over a range, like with JSTL's forEach tag?
POJOs
Should the framework call getModel multiple times as a page renders?
Spring
How can we create our Action objects from the Spring configuration?
Why would we want to create Action objects from the Spring configuration?
Velocity
I'm trying to run the example in the tutorial on Tomcat, and it can't instantiate the VelocityEngine
Ajax/Dojo
IE showing a prompt saying "This page contains both secure and nonsecure items" when using dojo
Issues in Specific Environments
Weblogic 8.1
JRockit
Multiple Struts 2 wars in a single ear
Google App Engine (GAE)
Extensions
Does the framework integrate with Hibernate?
Can we use JSTL with the framework?
Can we use JUnit with the framework?
Can we use TestNG with the framework?
How can we schedule Quartz jobs?
Can we use Acegi Security with the framework?
Portlet Support(JSR168)
Which portal servers are supported?
How to build the portlet WAR for a specific portal server
Migrating
Why is my action unavailable?
Errata?
To suggest a change or a correction to any part of the documentation, log in and leave a comment on the appropriate page. We are always looking for help with the documentation!
translate:
翻译:
添加新的常见问题
每个常见问题都应该在其中一个指南的相关页面中交叉引用。(如果指南中缺少相关页面,则可能需要创建一个页面!)每个问题都应该是新的一页。答案应该简明扼要。如果一个答案看起来很长,或者看起来可能涉及多个部分,那么这个问题可能涉及多个关注点。
常见问题也可以是“迷你如何做”。只要问题和答案集中在一个问题上,长度就不是问题。
迁移
请参阅迁移指南
总则
我们从哪里得到最新版本的框架?
框架的一些最佳特性是什么?
Struts和JSF的基本区别是什么?
你能提出一个电梯的建议吗?
如何
如何显示可以作为字节数组提供的动态或静态图像?
如何返回文本字符串作为响应?
如何测试应用程序?
我们如何测试动作?
如何上传文件?
如何在框架内下载文件?
我们如何强制操作映射(struts.xml)重新加载?
如何测试操作输出、验证或容器外的操作执行?
配置
我们能把一个大的struts.xml文件分成小块吗?
配置结果中的参数
使Struts对丢失的属性抛出异常,或者记录它们
访问资源
我们如何进入会议?
如何使会话无效?
我们如何访问HttpServletRequest?
我们如何访问HttpServletResponse?
如何访问传递到操作中的请求参数?
如何从操作访问静态参数?
我们可以访问一个操作的结果吗?
如何获取安全详细信息(JAAS)?
如何从视图访问操作调用、操作名称或命名空间?
每页设置
我可以每页换一个主题吗?
我可以每页更改templateDir吗?
我可以每页更改模板后缀吗?
拦截器
为什么我们的Prepare拦截器不被执行?
为什么我的setter没有被Params拦截器调用?
我们如何配置拦截器以用于每个操作?
验证
为什么在正确填写表单时我的操作返回“input”?
如何使用验证器内的消息?
如何修复“属性‘短路’”错误消息?
验证失败时如何重新填充控件?
如何对操作的验证逻辑进行单元测试?
为什么当我的邮件包含在CDATA中时,WW会忽略它?
本地化
我们如何更改区域设置?
如何设置全局资源包?
如何将XWork LocalizedTextUtil全局资源束加载与serlvets分离?
如何向UI标记添加I18N,比如textfield标记?
我可以在操作上下文之外添加I18N吗?
如何用Tomcat支持UTF-8uriencoding?
如何在表单中启用编码?
如何在资源包中转义特殊字符?
类型转换
如何更改特定字段的无效输入错误消息?
为什么应用程序记录复合根无法找到具有特定属性的特定对象的警告?
值堆栈
值堆栈中的默认变量是什么?
标签
为什么表单标记会在控件周围放置表标记?
如何在Javascript调用(例如onChange属性)中放置字符串文本?
为什么“if”标记不计算一个字符字符串?
为什么当我使用JSP标记时,FreeMarker会抱怨我的用户指令中有错误?
除了默认的execute方法之外,action标记还能运行其他方法吗?
当我有验证错误时,为什么我的动作标签没有被执行?
为什么请求参数会附加到我们的超链接?
为什么if标记evaluate test=“35; parameters.someParam…”适当地
如何渲染单个单选按钮?
为什么在将OGNL与JSP2.1一起使用时会得到javax.el.ELException?
为什么我不能在Struts标记中使用JSTL样式的EL表达式?
如何在一个范围内迭代,比如使用JSTL的forEach标记?
波乔
框架应该在页面呈现时多次调用getModel吗?
春天
如何从Spring配置创建动作对象?
为什么要从Spring配置创建动作对象?
速度
我正在尝试运行Tomcat教程中的示例,但它不能实例化VelocityEngine
阿贾克斯/道场
IE在使用dojo时显示提示“此页包含安全和非安全项”
特定环境中的问题
Weblogic 8.1版
JRockit公司
多个Struts在一个耳朵里打了两场仗
谷歌应用引擎(GAE)
扩展
框架是否与Hibernate集成?
我们可以在框架中使用JSTL吗?
我们可以在框架中使用JUnit吗?
我们可以在框架中使用TestNG吗?
我们如何安排石英工作?
我们可以在框架中使用Acegi安全吗?
Portlet支持(JSR168)
支持哪些门户服务器?
如何为特定门户服务器构建portlet WAR
迁移
为什么我的操作不可用?
勘误表?
要建议对文档的任何部分进行更改或更正,请登录并在相应的页面上留下评论。我们一直在寻找帮助与文件!