简体   繁体   English

设计/实现问题— Java / JSP / Servlet

[英]Design/Implementation Problem — Java/JSP/Servlets

Bear with me so I can explain the layout of my problem. 忍受我,以便我可以解释我的问题的布局。 I am working on a website/web application that involves customers searching for real estate information. 我正在开发一个涉及客户搜索房地产信息的网站/网络应用程序。 One feature on the website involves the customer performing a search on one page(well call this page A ) and the following page( Page B ) returns a list of line items that represent real estate information(agents,homes,etc). 网站上的一项功能涉及客户在一页上进行搜索(也称此页A ),而下一页( B页 )返回代表房地产信息(代理商,房屋等)的订单项列表。

Following the customer being able to view this list of information, they can select "View Profile" to view one of these line items of real estate information. 在客户能够查看此信息列表之后,他们可以选择“查看配置文件”以查看这些房地产信息行项目之一。 This will then bring them to a page to view a profile( Page C ) of the selected information. 然后将其带到页面以查看所选信息的配置文件( 页面C )。

The problem I am having is in designing/implementing one of the specifications for this feature. 我遇到的问题是设计/实现此功能的规范之一。 The requirements state that once a customer has proceeded to Page B where they are viewing the information. 要求指出,一旦客户进入页面B ,他们正在查看信息。 If they do not choose to go to Page C then an email needs to be sent. 如果他们没有选择进入页面C,则需要发送电子邮件。 They can go back and forth between A and B as many times as they want, but if they fail to choose to go to the next step, then an email needs to be sent. 他们可以根据需要在AB之间来回多次,但是,如果他们无法选择继续进行下一步,则需要发送电子邮件。

I apologize if this is a bad description, but I am unfortunately unable to give a more detailed description of the problem. 如果这是一个不好的描述,我深表歉意,但是很遗憾,我无法对该问题进行更详细的描述。 I hope I was able to explain this well enough to understand. 我希望我能够对此进行充分的解释以至于能够理解。

  • Maintain a state for each http session. 维护每个http会话的状态。 Have 3 session states - 'VisitedA' , 'VisitedB' and 'VisitedC' . 具有3个会话状态-'VisitedA''VisitedB''VisitedC' The start state when the user lands on PageA is 'VisitedA' . 用户登陆到PageA的开始状态为'VisitedA' Once the user moves to PageB, change the state to 'VisitedB' and Once the user moves to PageC, change the state to 'VisitedC' . 用户移至PageB时,将状态更改为'VisitedB' ;用户移至PageC时,将状态更改为'VisitedC'
  • Maintain the time of last activity for each http session by recording the timestamps for GET, POST or other events on the site. 通过记录站点上GET,POST或其他事件的时间戳来维护每个http会话的上次活动时间。
  • Decide on a threshold duration of inactivity, say 'ThresholdTime' , after which the user will be considered to have abandoned the site. 确定不活动的阈值持续时间,例如“ ThresholdTime” ,此后将认为用户已放弃该站点。 For example, if 'ThresholdTime' is 30 minutes, then if the times of last activity for an http session is older than 30 minutes, the associated user will be considered to have abandoned the site. 例如,如果“ ThresholdTime”为30分钟,则如果http会话的上一次活动时间早于30分钟,则关联的用户将被视为已放弃该站点。
  • Use a scheduler API eg Quartz and schedule a job that will look at the stored data for all http sessions and find out the sessions whose period of inactivity is greater than 'ThresholdTime' and whose state is 'VisitedB' . 使用一个调度程序API(例如Quartz) ,调度一个作业,该作业将查看所有http会话的存储数据,并找出不活动时间大于“ ThresholdTime”且状态为“ VisitedB”的会话 It will then sends emails to the users associated with those http sessions. 然后它将向与这些http会话关联的用户发送电子邮件。

Note that you'd need to maintain the time of last activity and state for each http session. 请注意,您需要维护每个http会话的上次活动时间和状态。 You will have to look for the suitable place to store this data eg in a HttpSession table. 您将必须寻找合适的位置来存储此数据,例如在HttpSession表中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM